Skip to content

Commit

Permalink
API-41329-dependent-option-in-docs-dropdown (#19585)
Browse files Browse the repository at this point in the history
* API-41329-dependent-option-in-docs-dropdown

* Adds dropdown request examples for veteran POA submission (self) and dependent POA submission
* Compiles V1 Docs to include dropdown with altered request example
	modified:   modules/claims_api/app/swagger/claims_api/v1/swagger.json
	modified:   modules/claims_api/spec/requests/v1/forms/rswag_2122_spec.rb

* WIP

* Copies over updates and removes line addition
  • Loading branch information
rockwellwindsor-va authored Nov 26, 2024
1 parent 2dcec65 commit 68ef67b
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 9 deletions.
46 changes: 38 additions & 8 deletions modules/claims_api/app/swagger/claims_api/v1/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -8904,14 +8904,6 @@
"required": [
"attributes"
],
"example": {
"type": "form/21-22",
"attributes": {
"serviceOrganization": {
"poaCode": "A1Q"
}
}
},
"properties": {
"attributes": {
"$schema": "http://json-schema.org/draft-07/schema#",
Expand Down Expand Up @@ -9324,6 +9316,44 @@
}
}
}
},
"examples": {
"POA for Veteran": {
"value": {
"data": {
"type": "form/21-22",
"attributes": {
"serviceOrganization": {
"poaCode": "A1Q"
}
}
}
}
},
"POA for Dependent Claimant": {
"value": {
"data": {
"type": "form/21-22",
"attributes": {
"serviceOrganization": {
"poaCode": "A1Q"
},
"claimant": {
"firstName": "Mary",
"lastName": "Lincoln",
"address": {
"numberAndStreet": "123 anystreet",
"city": "anytown",
"state": "OR",
"country": "USA",
"zipFirstFive": "12345"
},
"relationship": "Spouse"
}
}
}
}
}
}
}
},
Expand Down
45 changes: 44 additions & 1 deletion modules/claims_api/spec/requests/v1/forms/rswag_2122_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,37 @@
let(:'X-VA-Birth-Date') { '1986-05-06T00:00:00+00:00' }
let(:Authorization) { 'Bearer token' }

parameter SwaggerSharedComponents::V1.body_examples[:power_of_attorney]
claimant_data = {
'firstName' => 'Mary',
'lastName' => 'Lincoln',
'address' => {
'numberAndStreet' => '123 anystreet',
'city' => 'anytown',
'state' => 'OR',
'country' => 'USA',
'zipFirstFive' => '12345'
},
'relationship' => 'Spouse'
}

request_template = JSON.parse(Rails.root.join('modules', 'claims_api', 'spec', 'fixtures',
'form_2122_json_api.json').read)

request_template_with_dependent = JSON.parse(Rails.root.join('modules', 'claims_api', 'spec', 'fixtures',
'form_2122_json_api.json').read)
request_template_with_dependent['data']['attributes']['claimant'] = claimant_data

parameter name: :power_of_attorney_request, in: :body,
schema: SwaggerSharedComponents::V1.body_examples[:power_of_attorney][:schema]

parameter in: :body, examples: {
'POA for Veteran' => {
value: request_template
},
'POA for Dependent Claimant' => {
value: request_template_with_dependent
}
}

describe 'Getting a successful response' do
response '200', '2122 Response' do
Expand All @@ -104,6 +134,11 @@

temp
end

let(:power_of_attorney_request) do
data
end

let(:bgs_poa_verifier) { BGS::PowerOfAttorneyVerifier.new(nil) }

before do |example|
Expand Down Expand Up @@ -152,6 +187,10 @@
end
let(:Authorization) { nil }

let(:power_of_attorney_request) do
data
end

before do |example|
stub_poa_verification

Expand Down Expand Up @@ -189,6 +228,10 @@
temp
end

let(:power_of_attorney_request) do
data
end

before do |example|
allow_any_instance_of(ClaimsApi::V1::Forms::PowerOfAttorneyController)
.to receive(:check_request_ssn_matches_mpi).and_return(nil)
Expand Down

0 comments on commit 68ef67b

Please sign in to comment.