-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added test with external-ref (inside a dependency)
- Loading branch information
Showing
3 changed files
with
159 additions
and
0 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
105 changes: 105 additions & 0 deletions
105
...-plugin/examples/multi-module/sample-schema/src/main/resources/external-ref/petstore.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,105 @@ | ||
openapi: 3.0.0 | ||
servers: | ||
- url: 'http://petstore.swagger.io/v2' | ||
info: | ||
description: Sample file with just two endpoints and one schema (defined in an external file $ref) | ||
version: 1.0.0 | ||
title: OpenAPI Petstore | ||
paths: | ||
/pet: | ||
post: | ||
tags: | ||
- pet | ||
summary: Add a new pet to the store | ||
description: '' | ||
operationId: addPet | ||
responses: | ||
'200': | ||
description: successful operation | ||
content: | ||
application/xml: | ||
schema: | ||
$ref: '#/components/schemas/Pet' | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/Pet' | ||
'405': | ||
description: Invalid input | ||
security: | ||
- petstore_auth: | ||
- 'write:pets' | ||
- 'read:pets' | ||
requestBody: | ||
$ref: '#/components/requestBodies/Pet' | ||
'/pet/{petId}': | ||
get: | ||
tags: | ||
- pet | ||
summary: Find pet by ID | ||
description: Returns a single pet | ||
operationId: getPetById | ||
parameters: | ||
- name: petId | ||
in: path | ||
description: ID of pet to return | ||
required: true | ||
schema: | ||
type: integer | ||
format: int64 | ||
responses: | ||
'200': | ||
description: successful operation | ||
content: | ||
application/xml: | ||
schema: | ||
$ref: '#/components/schemas/Pet' | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/Pet' | ||
'400': | ||
description: Invalid ID supplied | ||
'404': | ||
description: Pet not found | ||
security: | ||
- api_key: [] | ||
delete: | ||
tags: | ||
- pet | ||
summary: Deletes a pet | ||
description: '' | ||
operationId: deletePet | ||
parameters: | ||
- name: api_key | ||
in: header | ||
required: false | ||
schema: | ||
type: string | ||
- name: petId | ||
in: path | ||
description: Pet id to delete | ||
required: true | ||
schema: | ||
type: integer | ||
format: int64 | ||
responses: | ||
'400': | ||
description: Invalid pet value | ||
security: | ||
- petstore_auth: | ||
- 'write:pets' | ||
- 'read:pets' | ||
components: | ||
requestBodies: | ||
Pet: | ||
content: | ||
application/json: | ||
schema: | ||
$ref: 'schemas/Pet.yaml' | ||
application/xml: | ||
schema: | ||
$ref: 'schemas/Pet.yaml' | ||
description: Pet object that needs to be added to the store | ||
required: true | ||
schemas: | ||
Pet: | ||
$ref: 'schemas/Pet.yaml' |
29 changes: 29 additions & 0 deletions
29
...ugin/examples/multi-module/sample-schema/src/main/resources/external-ref/schemas/Pet.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,29 @@ | ||
title: a Pet | ||
description: A pet for sale in the pet store | ||
type: object | ||
required: | ||
- name | ||
- photoUrls | ||
properties: | ||
id: | ||
type: integer | ||
format: int64 | ||
name: | ||
type: string | ||
example: doggie | ||
photoUrls: | ||
type: array | ||
xml: | ||
name: photoUrl | ||
wrapped: true | ||
items: | ||
type: string | ||
status: | ||
type: string | ||
description: pet status in the store | ||
enum: | ||
- available | ||
- pending | ||
- sold | ||
xml: | ||
name: Pet |