We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following schema compiles correctly:
openapi: 3.0.0 info: title: AnAPI version: 0.0.2-alpha paths: /inventory: get: operationId: Inventory Listing parameters: [] responses: '200': description: Inventory content: application/json: schema: $ref: '#/components/schemas/item_list' components: schemas: item_list: type: object required: [items] properties: items: type: array items: $ref: '#/components/schemas/item' item: type: object required: [name, id] properties: name: type: string id: type: string
The following, more compact version, does not:
openapi: 3.0.0 info: title: AnAPI version: 0.0.2-alpha paths: /inventory: get: operationId: Inventory Listing parameters: [] responses: '200': description: Inventory content: application/json: schema: type: array items: $ref: '#/components/schemas/item' components: schemas: item: type: object required: [name, id] properties: name: type: string id: type: string
The trick being FastAPI generates the second kind of schema, and implements it as if it were the first.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The following schema compiles correctly:
The following, more compact version, does not:
The trick being FastAPI generates the second kind of schema, and implements it as if it were the first.
The text was updated successfully, but these errors were encountered: