Skip to content

Commit

Permalink
Document poa endpoint (#16620)
Browse files Browse the repository at this point in the history
  • Loading branch information
holdenhinkle authored May 3, 2024
1 parent 0a481bd commit 7a5a98d
Show file tree
Hide file tree
Showing 3 changed files with 130 additions and 0 deletions.
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
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'
1 change: 1 addition & 0 deletions modules/representation_management/config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
namespace :v0, defaults: { format: 'json' } do
resources :flag_accredited_representatives, only: %i[create]
resources :power_of_attorney, only: %i[index]
get 'apidocs', to: 'apidocs#index'
end
end

0 comments on commit 7a5a98d

Please sign in to comment.