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 "type" keyword just generates an empty schema in openapi.
No response
# Your MCVE code here import json from typing import TypeAlias, Literal from litestar import Controller, Litestar, get AliasArg: TypeAlias = Literal[456] type TypeArg = Literal[123] class Test(Controller): @get(path="/test") async def test(self, alias_arg: AliasArg, type_arg: TypeArg) -> None: ... if __name__ == "__main__": app = Litestar( route_handlers=[Test], ) print(json.dumps(app.openapi_schema.to_schema(), indent=4))
Output looks like:
{ "info": { "title": "Litestar API", "version": "1.0.0" }, "openapi": "3.1.0", "servers": [ { "url": "/" } ], "paths": { "/test": { "get": { "summary": "Test", "operationId": "TestTest", "parameters": [ { "name": "alias_arg", "in": "query", "schema": { "type": "integer", "const": 456 }, "required": true, "deprecated": false, "allowEmptyValue": false, "allowReserved": false }, { "name": "type_arg", "in": "query", "schema": {}, "required": true, "deprecated": false, "allowEmptyValue": false, "allowReserved": false } ], "responses": { "200": { "description": "Request fulfilled, document follows", "headers": {} }, "400": { "description": "Bad request syntax or unsupported method", "content": { "application/json": { "schema": { "properties": { "status_code": { "type": "integer" }, "detail": { "type": "string" }, "extra": { "additionalProperties": {}, "type": [ "null", "object", "array" ] } }, "type": "object", "required": [ "detail", "status_code" ], "description": "Validation Exception", "examples": [ { "status_code": 400, "detail": "Bad Request", "extra": {} } ] } } } } }, "deprecated": false } } }, "components": { "schemas": {} } }
1. Run example code 2. Inspect openapi output
""
2.10.0
Note
While we are open for sponsoring on GitHub Sponsors and OpenCollective, we also utilize Polar.sh to engage in pledge-based sponsorship.
Check out all issues funded or available for funding on our Polar.sh dashboard
The text was updated successfully, but these errors were encountered:
type
This issue has been closed in #3715. The change will be included in the upcoming patch release.
Sorry, something went wrong.
A fix for this issue has been released in v2.14.0
Successfully merging a pull request may close this issue.
Description
The "type" keyword just generates an empty schema in openapi.
URL to code causing the issue
No response
MCVE
Output looks like:
Steps to reproduce
Screenshots
""
Logs
No response
Litestar Version
2.10.0
Platform
Note
While we are open for sponsoring on GitHub Sponsors and
OpenCollective, we also utilize Polar.sh to engage in pledge-based sponsorship.
Check out all issues funded or available for funding on our Polar.sh dashboard
The text was updated successfully, but these errors were encountered: