Skip to content

Commit

Permalink
Provide example string error, correct content type
Browse files Browse the repository at this point in the history
  • Loading branch information
opticbob committed Nov 26, 2024
1 parent 0dc7ec3 commit 5423612
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
7 changes: 4 additions & 3 deletions modules/representation_management/app/swagger/v0/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@
}
},
"Error": {
"type": "string"
"type": "string",
"example": "Veteran first name can't be blank"
},
"PowerOfAttorneyResponse": {
"type": "object",
Expand Down Expand Up @@ -210,7 +211,7 @@
"422": {
"description": "unprocessable entity response",
"content": {
"application/pdf": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Errors"
}
Expand Down Expand Up @@ -443,7 +444,7 @@
"422": {
"description": "unprocessable entity response",
"content": {
"application/pdf": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Errors"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,20 @@
post('Generate a PDF for form 21-22') do
tags 'PDF Generation'
consumes 'application/json'
produces 'application/pdf'
operationId 'createPdfForm2122'

parameter SwaggerSharedComponents::V0.body_examples[:pdf_generator2122_parameter]

response '200', 'PDF generated successfully' do
produces 'application/pdf'
let(:pdf_generator2122) do
SwaggerSharedComponents::V0.body_examples[:pdf_generator2122]
end
run_test!
end

response '422', 'unprocessable entity response' do
produces 'application/json'
let(:pdf_generator2122) do
params = SwaggerSharedComponents::V0.body_examples[:pdf_generator2122]
params[:veteran][:name].delete(:first)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,20 @@
post('Generate a PDF for form 21-22a') do
tags 'PDF Generation'
consumes 'application/json'
produces 'application/pdf'
operationId 'createPdfForm2122a'

parameter SwaggerSharedComponents::V0.body_examples[:pdf_generator2122a_parameter]

response '200', 'PDF generated successfully' do
produces 'application/pdf'
let(:pdf_generator2122a) do
SwaggerSharedComponents::V0.body_examples[:pdf_generator2122a]
end
run_test!
end

response '422', 'unprocessable entity response' do
produces 'application/json'
let(:pdf_generator2122a) do
params = SwaggerSharedComponents::V0.body_examples[:pdf_generator2122a]
params[:veteran][:name].delete(:first)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ def errors

def error
{
type: :string
type: :string,
example: "Veteran first name can't be blank"
}
end

Expand Down

0 comments on commit 5423612

Please sign in to comment.