-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix generating models for inline arrays
- Loading branch information
gcornacchia
committed
Nov 28, 2024
1 parent
4632508
commit 3c95a31
Showing
4 changed files
with
297 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,273 @@ | ||
{ | ||
"openapi": "3.0.2", | ||
"info": { | ||
"title": "Swagger Petstore - OpenAPI 3.0", | ||
"description": "This is a sample Pet Store Server based on the OpenAPI 3.0 specification. You can find out more about\nSwagger at [https://swagger.io](https://swagger.io). In the third iteration of the pet store, we've switched to the design first approach!\nYou can now help us improve the API whether it's by making changes to the definition itself or to the code.\nThat way, with time, we can improve the API in general, and expose some of the new features in OAS3.\n\n_If you're looking for the Swagger 2.0/OAS 2.0 version of Petstore, then click [here](https://editor.swagger.io/?url=https://petstore.swagger.io/v2/swagger.yaml). Alternatively, you can load via the `Edit > Load Petstore OAS 2.0` menu option!_\n\nSome useful links:\n- [The Pet Store repository](https://github.com/swagger-api/swagger-petstore)\n- [The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml)", | ||
"termsOfService": "http://swagger.io/terms/", | ||
"contact": { | ||
"email": "[email protected]" | ||
}, | ||
"license": { | ||
"name": "Apache 2.0", | ||
"url": "http://www.apache.org/licenses/LICENSE-2.0.html" | ||
}, | ||
"version": "1.0.11" | ||
}, | ||
"externalDocs": { | ||
"description": "Find out more about Swagger", | ||
"url": "http://swagger.io" | ||
}, | ||
"servers": [ | ||
{ | ||
"url": "https://petstore3.swagger.io/api/v3" | ||
} | ||
], | ||
"tags": [ | ||
{ | ||
"name": "pet", | ||
"description": "Everything about your Pets", | ||
"externalDocs": { | ||
"description": "Find out more", | ||
"url": "http://swagger.io" | ||
} | ||
}, | ||
{ | ||
"name": "store", | ||
"description": "Access to Petstore orders", | ||
"externalDocs": { | ||
"description": "Find out more about our store", | ||
"url": "http://swagger.io" | ||
} | ||
}, | ||
{ | ||
"name": "user", | ||
"description": "Operations about user" | ||
} | ||
], | ||
"paths": { | ||
"/pet": { | ||
"put": { | ||
"tags": [ | ||
"pet" | ||
], | ||
"summary": "Update an existing pet", | ||
"description": "Update an existing pet by Id", | ||
"operationId": "updatePet", | ||
"requestBody": { | ||
"description": "Update an existent pet in the store", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"required": [ | ||
"name", | ||
"photoUrls" | ||
], | ||
"properties": { | ||
"id": { | ||
"type": "integer", | ||
"format": "int64", | ||
"example": 10 | ||
}, | ||
"name": { | ||
"type": "string", | ||
"example": "doggie" | ||
}, | ||
"category": { | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "integer", | ||
"format": "int64", | ||
"example": 1 | ||
}, | ||
"name": { | ||
"type": "string", | ||
"example": "Dogs" | ||
} | ||
}, | ||
"xml": { | ||
"name": "category" | ||
} | ||
}, | ||
"photoUrls": { | ||
"type": "array", | ||
"xml": { | ||
"wrapped": true | ||
}, | ||
"items": { | ||
"type": "string", | ||
"xml": { | ||
"name": "photoUrl" | ||
} | ||
} | ||
}, | ||
"tags": { | ||
"type": "array", | ||
"xml": { | ||
"wrapped": true | ||
}, | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "integer", | ||
"format": "int64" | ||
}, | ||
"name": { | ||
"type": "string" | ||
} | ||
}, | ||
"xml": { | ||
"name": "tag" | ||
} | ||
} | ||
}, | ||
"status": { | ||
"type": "string", | ||
"description": "pet status in the store", | ||
"enum": [ | ||
"available", | ||
"pending", | ||
"sold" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"description": "Successful operation", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"required": [ | ||
"name", | ||
"photoUrls" | ||
], | ||
"properties": { | ||
"id": { | ||
"type": "integer", | ||
"format": "int64", | ||
"example": 10 | ||
}, | ||
"name": { | ||
"type": "string", | ||
"example": "doggie" | ||
}, | ||
"category": { | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "integer", | ||
"format": "int64", | ||
"example": 1 | ||
}, | ||
"name": { | ||
"type": "string", | ||
"example": "Dogs" | ||
} | ||
}, | ||
"xml": { | ||
"name": "category" | ||
} | ||
}, | ||
"photoUrls": { | ||
"type": "array", | ||
"xml": { | ||
"wrapped": true | ||
}, | ||
"items": { | ||
"type": "string", | ||
"xml": { | ||
"name": "photoUrl" | ||
} | ||
} | ||
}, | ||
"tags": { | ||
"type": "array", | ||
"xml": { | ||
"wrapped": true | ||
}, | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "integer", | ||
"format": "int64" | ||
}, | ||
"name": { | ||
"type": "string" | ||
} | ||
}, | ||
"xml": { | ||
"name": "tag" | ||
} | ||
} | ||
}, | ||
"status": { | ||
"type": "string", | ||
"description": "pet status in the store", | ||
"enum": [ | ||
"available", | ||
"pending", | ||
"sold" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"400": { | ||
"description": "Invalid ID supplied" | ||
}, | ||
"404": { | ||
"description": "Pet not found" | ||
}, | ||
"422": { | ||
"description": "Validation exception" | ||
} | ||
}, | ||
"security": [ | ||
{ | ||
"petstore_auth": [ | ||
"write:pets", | ||
"read:pets" | ||
] | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"components": { | ||
"securitySchemes": { | ||
"petstore_auth": { | ||
"type": "oauth2", | ||
"flows": { | ||
"implicit": { | ||
"authorizationUrl": "https://petstore3.swagger.io/oauth/authorize", | ||
"scopes": { | ||
"write:pets": "modify pets in your account", | ||
"read:pets": "read your pets" | ||
} | ||
} | ||
} | ||
}, | ||
"api_key": { | ||
"type": "apiKey", | ||
"name": "api_key", | ||
"in": "header" | ||
} | ||
} | ||
} | ||
} |