forked from swagger-api/swagger-parser
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request swagger-api#1609 from swagger-api/issue-1561
Fix and Issue 1561: Add resolved responses to components section in main spec
- Loading branch information
Showing
6 changed files
with
151 additions
and
3 deletions.
There are no files selected for viewing
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
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
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
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
67 changes: 67 additions & 0 deletions
67
modules/swagger-parser-v3/src/test/resources/issue-1561/exceptions.yml
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,67 @@ | ||
components: | ||
schemas: | ||
Exception: | ||
type: object | ||
Rfc7807Exception: | ||
description: The Rfc7807 specification for exceptions. | ||
allOf: | ||
- $ref: '#/components/schemas/Exception' | ||
- type: object | ||
properties: | ||
type: | ||
type: string | ||
description: A URI reference that identifies the problem type. | ||
required: | ||
- type | ||
- title | ||
- status | ||
- detail | ||
AbsisExceptionType: | ||
type: string | ||
enum: [VALIDATION, BUSINESS, RUNTIME, CHALLENGE, NOTFOUND, UNAUTHORIZED, AUTHENTICATION] | ||
description: The possible types of an AbsisException. | ||
AbsisFieldError: | ||
type: object | ||
description: The representation of a validation error. | ||
properties: | ||
code: | ||
type: string | ||
description: The error code. | ||
example: | ||
code: request | ||
parameters: | ||
- codes: | ||
- aCode | ||
- otherCode | ||
value: NotNull | ||
AbsisException: | ||
description: Representation of an exception. | ||
allOf: | ||
- $ref: '#/components/schemas/Rfc7807Exception' | ||
- type: object | ||
properties: | ||
_class: | ||
type: string | ||
description: The canonical name of the class AbsisException. | ||
cause: | ||
$ref: '#/components/schemas/AbsisException' | ||
description: The AbsisException wrapping the exception that originated this exception. | ||
responses: | ||
'400': | ||
description: Error when validating input parameters or request body. | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/AbsisException' | ||
'404': | ||
description: The endpoint does not exists or the attempted resource does not exist. | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/AbsisException' | ||
'500': | ||
description: Unexpected error occurred at one of the layers of the microservice, controller, business service, repository etc. | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/AbsisException' |
67 changes: 67 additions & 0 deletions
67
modules/swagger-parser-v3/src/test/resources/issue-1561/swagger.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,67 @@ | ||
openapi: 3.0.0 | ||
info: | ||
description: The Trazabilidad API offers the functionalities of the new trace regardless of the channel in which it is in invoked. | ||
version: 1.0.2 | ||
title: ApiTrazabilidad | ||
|
||
tags: | ||
- name: Trazabilidad | ||
description: Trazabilidad API | ||
paths: | ||
'/operationalServices/tracks/scopes/{scopeId}/processes/{processId}/petitions': | ||
post: | ||
tags: | ||
- createPetition | ||
summary: Creates a new instance in the traceability operation. | ||
operationId: createPetition | ||
description: Creates a new instance in the traceability operation. | ||
parameters: | ||
- in: path | ||
name: processId | ||
description: instance process ID | ||
required: true | ||
schema: | ||
type: integer | ||
requestBody: | ||
$ref: '#/components/requestBodies/TrazabilidadBodyRequest' | ||
responses: | ||
'201': | ||
description: Created | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/BodyOutResponse' | ||
'400': | ||
$ref: >- | ||
exceptions.yml#/components/responses/400 | ||
'404': | ||
$ref: >- | ||
exceptions.yml#/components/responses/404 | ||
'500': | ||
$ref: >- | ||
exceptions.yml#/components/responses/500 | ||
components: | ||
requestBodies: | ||
TrazabilidadBodyRequest: | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/TrazabilidadBodyRequest' | ||
description: body request | ||
required: true | ||
schemas: | ||
BodyOutResponse: | ||
type: object | ||
properties: | ||
petitionId: | ||
type: string | ||
description: The ID of the request that has been created | ||
example: "971205125921" | ||
TrazabilidadBodyRequest: | ||
type: object | ||
properties: | ||
action: | ||
type: string | ||
description: Action to be performed. values -- alta , mod , fin , baja | ||
example: "alta" |