-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0a481bd
commit 7a5a98d
Showing
3 changed files
with
130 additions
and
0 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
...resentation_management/app/controllers/representation_management/v0/apidocs_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# frozen_string_literal: true | ||
|
||
module RepresentationManagement | ||
module V0 | ||
class ApidocsController < ApplicationController | ||
service_tag 'representation-management' | ||
skip_before_action :authenticate | ||
|
||
def index | ||
swagger = YAML.safe_load(File.read(RepresentationManagement::Engine.root.join('app/docs/representation_management/v0/power_of_attorney_controller.yaml'))) # rubocop:disable Layout/LineLength | ||
|
||
render json: swagger | ||
end | ||
end | ||
end | ||
end |
113 changes: 113 additions & 0 deletions
113
...tation_management/app/docs/representation_management/v0/power_of_attorney_controller.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
openapi: '3.0.0' | ||
info: | ||
version: 1.0.0 | ||
title: Power of Attorney API | ||
description: This API returns the Power of Attorney for veterans. | ||
contact: | ||
name: va.gov | ||
tags: | ||
- name: power_of_attorney | ||
description: Retrieve Power of Attorney details for a veteran. | ||
servers: | ||
- url: http://localhost:3000/services/representation_management | ||
description: VA.gov API local environment | ||
- url: https://staging-api.va.gov/services/representation_management | ||
description: VA.gov API staging environment | ||
- url: https://api.va.gov/services/representation_management | ||
description: VA.gov API production environment | ||
paths: | ||
/v0/power_of_attorney: | ||
get: | ||
summary: Get Power of Attorney | ||
description: Retrieves the Power of Attorney for a veteran, if any. | ||
operationId: getPowerOfAttorney | ||
tags: | ||
- Power of Attorney | ||
responses: | ||
'200': | ||
description: > | ||
Successfully checked for Power of Attorney information. Returns Power of Attorney details if available; otherwise, returns an empty object. | ||
content: | ||
application/json: | ||
schema: | ||
oneOf: | ||
- type: object | ||
properties: | ||
data: | ||
type: object | ||
properties: | ||
type: | ||
type: string | ||
example: 'organization' # Example for organization type | ||
description: Type of Power of Attorney representation | ||
name: | ||
type: string | ||
example: 'Veterans Association' | ||
address_line1: | ||
type: string | ||
example: '1234 Freedom Blvd' | ||
city: | ||
type: string | ||
example: 'Arlington' | ||
state_code: | ||
type: string | ||
example: 'VA' | ||
zip_code: | ||
type: string | ||
example: '22204' | ||
phone: | ||
type: string | ||
example: '555-1234' | ||
email: | ||
type: string | ||
example: '[email protected]' | ||
required: | ||
- type | ||
- name | ||
- address_line1 | ||
- city | ||
- state_code | ||
- zip_code | ||
- type: object | ||
description: An empty JSON object indicating no Power of Attorney exists. | ||
example: {} | ||
components: | ||
schemas: | ||
BadRequestError: | ||
type: object | ||
properties: | ||
errors: | ||
type: array | ||
items: | ||
type: object | ||
properties: | ||
title: | ||
type: string | ||
example: 'Invalid field value' | ||
detail: | ||
type: string | ||
example: 'Field value is not valid' | ||
code: | ||
type: string | ||
example: '103' | ||
status: | ||
type: string | ||
example: '400' | ||
InternalServerError: | ||
type: object | ||
properties: | ||
errors: | ||
type: object | ||
properties: | ||
title: | ||
type: string | ||
example: 'Internal server error' | ||
detail: | ||
type: string | ||
example: 'Unexpected error occurred' | ||
code: | ||
type: string | ||
example: '500' | ||
status: | ||
type: string | ||
example: '500' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters