Skip to content
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

OpenAPI: Add support for const #56

Closed
JonasHeylen opened this issue Feb 2, 2023 · 2 comments
Closed

OpenAPI: Add support for const #56

JonasHeylen opened this issue Feb 2, 2023 · 2 comments

Comments

@JonasHeylen
Copy link

The const keyword that is part of the JSON Schema spec (https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-00#section-6.1.3) is not yet supported by sttp-apispec.

Adding support for this would make it possible to define enums with a description of each enum value, as suggested in json-schema-org/json-schema-vocabularies#47 and OAI/OpenAPI-Specification#348.

Example:

  oneOf:
    - const: D
      description: Suspicious transaction
    - const: I
      description: Failed data validation check
@hamnis
Copy link
Contributor

hamnis commented Jul 5, 2023

This can be closed, was fixed in #69

@adamw
Copy link
Member

adamw commented Jul 6, 2023

Thanks, closing :)

@adamw adamw closed this as completed Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants