-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
42d4c6b
commit a064441
Showing
7 changed files
with
749 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
145 changes: 145 additions & 0 deletions
145
openapi-cli/src/test/resources/cmd/flatten/flattened_openapi_expected.json
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,145 @@ | ||
{ | ||
"openapi" : "3.0.0", | ||
"info" : { | ||
"title" : "Swagger Petstore", | ||
"license" : { | ||
"name" : "MIT" | ||
}, | ||
"version" : "1.0.0" | ||
}, | ||
"servers" : [ { | ||
"url" : "/" | ||
} ], | ||
"paths" : { | ||
"/pets" : { | ||
"get" : { | ||
"tags" : [ "pets" ], | ||
"summary" : "List all pets", | ||
"operationId" : "listPets", | ||
"responses" : { | ||
"200" : { | ||
"description" : "An paged array of pets", | ||
"headers" : { | ||
"x-next" : { | ||
"description" : "A link to the next page of responses", | ||
"style" : "simple", | ||
"explode" : false, | ||
"schema" : { | ||
"type" : "string" | ||
} | ||
} | ||
}, | ||
"content" : { | ||
"application/json" : { | ||
"schema" : { | ||
"type" : "array", | ||
"items" : { | ||
"$ref" : "#/components/schemas/InlineResponse200" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"post" : { | ||
"tags" : [ "pets" ], | ||
"summary" : "Create a pet", | ||
"operationId" : "createPets", | ||
"requestBody" : { | ||
"description" : "Created pet object", | ||
"content" : { | ||
"application/json" : { | ||
"schema" : { | ||
"$ref" : "#/components/schemas/PetsBody" | ||
} | ||
} | ||
}, | ||
"required" : true | ||
}, | ||
"responses" : { | ||
"201" : { | ||
"description" : "Null response" | ||
} | ||
} | ||
} | ||
}, | ||
"/locations" : { | ||
"get" : { | ||
"tags" : [ "locations" ], | ||
"summary" : "List all locations", | ||
"operationId" : "listLocations", | ||
"parameters" : [ { | ||
"name" : "area", | ||
"in" : "query", | ||
"description" : "area to filter by", | ||
"required" : false, | ||
"style" : "form", | ||
"explode" : true, | ||
"schema" : { | ||
"type" : "string" | ||
} | ||
} ], | ||
"responses" : { | ||
"200" : { | ||
"description" : "An paged array of locations", | ||
"headers" : { | ||
"x-next" : { | ||
"description" : "A link to the next page of responses", | ||
"style" : "simple", | ||
"explode" : false, | ||
"schema" : { | ||
"type" : "string" | ||
} | ||
} | ||
}, | ||
"content" : { | ||
"application/json" : { | ||
"schema" : { | ||
"type" : "array", | ||
"items" : { | ||
"$ref" : "#/components/schemas/PetsBody" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components" : { | ||
"schemas" : { | ||
"InlineResponse200" : { | ||
"type" : "object", | ||
"properties" : { | ||
"id" : { | ||
"type" : "integer", | ||
"format" : "int64" | ||
}, | ||
"name" : { | ||
"type" : "string" | ||
}, | ||
"tag" : { | ||
"type" : "string" | ||
} | ||
} | ||
}, | ||
"PetsBody" : { | ||
"type" : "object", | ||
"properties" : { | ||
"id" : { | ||
"type" : "integer", | ||
"format" : "int64" | ||
}, | ||
"name" : { | ||
"type" : "string" | ||
}, | ||
"tag" : { | ||
"type" : "string" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
99 changes: 99 additions & 0 deletions
99
openapi-cli/src/test/resources/cmd/flatten/flattened_openapi_expected.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,99 @@ | ||
openapi: 3.0.0 | ||
info: | ||
title: Swagger Petstore | ||
license: | ||
name: MIT | ||
version: 1.0.0 | ||
servers: | ||
- url: / | ||
paths: | ||
/pets: | ||
get: | ||
tags: | ||
- pets | ||
summary: List all pets | ||
operationId: listPets | ||
responses: | ||
"200": | ||
description: An paged array of pets | ||
headers: | ||
x-next: | ||
description: A link to the next page of responses | ||
style: simple | ||
explode: false | ||
schema: | ||
type: string | ||
content: | ||
application/json: | ||
schema: | ||
type: array | ||
items: | ||
$ref: "#/components/schemas/InlineResponse200" | ||
post: | ||
tags: | ||
- pets | ||
summary: Create a pet | ||
operationId: createPets | ||
requestBody: | ||
description: Created pet object | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/PetsBody" | ||
required: true | ||
responses: | ||
"201": | ||
description: Null response | ||
/locations: | ||
get: | ||
tags: | ||
- locations | ||
summary: List all locations | ||
operationId: listLocations | ||
parameters: | ||
- name: area | ||
in: query | ||
description: area to filter by | ||
required: false | ||
style: form | ||
explode: true | ||
schema: | ||
type: string | ||
responses: | ||
"200": | ||
description: An paged array of locations | ||
headers: | ||
x-next: | ||
description: A link to the next page of responses | ||
style: simple | ||
explode: false | ||
schema: | ||
type: string | ||
content: | ||
application/json: | ||
schema: | ||
type: array | ||
items: | ||
$ref: "#/components/schemas/PetsBody" | ||
components: | ||
schemas: | ||
InlineResponse200: | ||
type: object | ||
properties: | ||
id: | ||
type: integer | ||
format: int64 | ||
name: | ||
type: string | ||
tag: | ||
type: string | ||
PetsBody: | ||
type: object | ||
properties: | ||
id: | ||
type: integer | ||
format: int64 | ||
name: | ||
type: string | ||
tag: | ||
type: string |
Oops, something went wrong.