Skip to content

Support for const definitions #685

@tshelburne

Description

@tshelburne

Currently we have to use the following schema to define constants:

value:
  type: string
  enum: [some-constant]

Which results in:

type value = 'some-constant'

JSON schema supports defining with the const property, and it looks like OAI has adopted it as well? The definition would look like this:

value:
  type: string
  const: some-constant

And would result in the same Typescript as above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    PRs welcomePRs are welcome to solve this issue!enhancementNew feature or requestplannedExpected in an upcoming version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions