Skip to content

const values are not displayed #1142

@markrzen

Description

@markrzen

Describe the bug

In OpenAPI 3.1.1 const was adopted. Currently these values are not shown in the plugins.

Not sure if you want to call this a bug or a feature. Either way the supported const values are missing :)

Expected behavior

const values are displayed

Current behavior

const values are not displayed

Possible solution

Detect schema.const and output it like we do for Example or Default.

It would need to happen for primitive (E.g. string) and complex types (E.g. allOf, oneOf, etc.).

Steps to reproduce

        type:
          const: orders
          type: string
          title: Orders
      description: The status of the Order
      type: string
      oneOf:
        - const: incomplete
          type: string
          title: Incomplete
          description: Incomplete order
        - const: pending
          type: string
          title: Pending
          description: Pending order
        - const: complete
          type: string
          title: Complete
          description: Complete order

Screenshots

Context

Your Environment

  • Version used:
  • Environment name and version (e.g. Chrome 59, node.js 5.4, python 3.7.3):
  • Operating System and version (desktop or mobile):
  • Link to your project:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions