Skip to content

Commit

Permalink
Add error examples
Browse files Browse the repository at this point in the history
  • Loading branch information
opticbob committed Oct 8, 2024
1 parent 77e9566 commit 40cd6b1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
18 changes: 12 additions & 6 deletions modules/representation_management/app/swagger/v0/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,33 @@
],
"properties": {
"title": {
"type": "string"
"type": "string",
"example": "Unprocessable Entity"
},
"detail": {
"type": "string"
"type": "string",
"example": "Your request could not be processed"
},
"code": {
"type": "string"
"type": "string",
"example": "422"
},
"status": {
"type": "string"
"type": "string",
"example": "422"
},
"meta": {
"type": "object",
"properties": {
"exception": {
"type": "string"
"type": "string",
"example": "UnprocessableEntity"
},
"backtrace": {
"type": "array",
"items": {
"type": "string"
"type": "string",
"example": "stack trace line"
}
}
}
Expand Down
18 changes: 12 additions & 6 deletions modules/representation_management/spec/support/rswag_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,23 @@ def config # rubocop:disable Metrics/MethodLength
type: :object,
required: [:title],
properties: {
title: { type: :string },
detail: { type: :string },
code: { type: :string },
status: { type: :string },
title: { type: :string,
example: 'Unprocessable Entity' },
detail: { type: :string,
example: 'Your request could not be processed' },
code: { type: :string,
example: '422' },
status: { type: :string,
example: '422' },
meta: {
type: :object,
properties: {
exception: { type: :string },
exception: { type: :string,
example: 'UnprocessableEntity' },
backtrace: {
type: :array,
items: { type: :string }
items: { type: :string,
example: 'stack trace line' }
}
}
}
Expand Down

0 comments on commit 40cd6b1

Please sign in to comment.