Open
Description
Description
Setting the title of an Enum with Body()
or msgspec.Meta
like so will still not allow it be shown in the autogenerated OpenAPI spec even if you try setting schema_name does not work:
class UniversalClassificationScoringMethod(StrEnum):
AUTO = "auto"
CHUNK_MAX = "chunk_max"
CHUNK_AVG = "chunk_avg"
CHUNK_MIN = "chunk_min"
UniversalClassificationScoringMethod.__schema_name__ = "Universal classification scoring method"
UniversalClassificationScoringMethod = Annotated[
UniversalClassificationScoringMethod,
Meta(
title="Universal classification scoring method",
),
Body(
title="Universal classification scoring method",
description="A method for producing an overall confidence score for a universal classification.",
examples=[Example(value=UniversalClassificationScoringMethod.AUTO)],
),
]
This also applies to msgspec Struct's, however, schema_name does at least still work.
URL to code causing the issue
No response
MCVE
# Your MCVE code here
Steps to reproduce
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
Screenshots
""
Logs
Litestar Version
2.14.0
Platform
- Linux
- Mac
- Windows
- Other (Please specify in the description above)
Activity