-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
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
OAS 3.1 "const" keyword support? #1223
Comments
Spectacular does not explicitly generate single value enums by itself.
The concept of constant values is not really a thing in DRF.
You can write a postprocessing hook yourself though. I don't see this as
worth the effort at the moment since this is basically an existing
functionality that looks just a bit prettier.
…On Wed, Apr 17, 2024, 11:57 Slava M. ***@***.***> wrote:
OAI/OpenAPI-Specification#1977
<OAI/OpenAPI-Specification#1977> introduced
support for JSON Schema Draft 2019-09, which has introduced const
<https://json-schema.org/draft/2019-09/json-schema-validation#rfc.section.6.1.3>
keyword.
drf-spectacular docs say "We now also support 3.1.0"
<https://drf-spectacular.readthedocs.io/en/latest/settings.html#:~:text=We%20now%20also%20support%203.1.0%2C>,
so I wonder if const keyword generated in schema is supported and how to
force schema to generate it?
Is it possible to introduce this keyword through custom extension?
—
Reply to this email directly, view it on GitHub
<#1223>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADHB2ENBJOOLGVQUYRSAIGDY5ZBQPAVCNFSM6AAAAABGK7GPOGVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI2DOOBYGM3TKNI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
OAI/OpenAPI-Specification#1977 introduced support for JSON Schema Draft 2019-09, which has introduced
const
keyword.drf-spectacular docs say "We now also support 3.1.0", so I wonder if
const
keyword generated in schema is supported and how to force schema to generate it?Is it possible to introduce this keyword through custom extension?
The text was updated successfully, but these errors were encountered: