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

3.1.0 spec processing const with boolean/integer value stored as string rather than boolean/Boolean/integer/Integer #1966

Closed
spacether opened this issue Aug 21, 2023 · 0 comments

Comments

@spacether
Copy link
Contributor

spacether commented Aug 21, 2023

3.1.0 spec processing const with boolean value stored as string rather than boolean/Boolean

When parsing this spec:

# OAS document that uses 3.1 features:
# 'null' type
# type array
openapi: 3.1.0
info:
  version: 1.0.0
  title: Example
  license:
    name: MIT
    identifier: MIT
servers:
  - url: http://api.example.xyz/v1
paths:
  /somePath:
    get:
      operationId: getSomePath
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema: {}
components:
  schemas:
    BooleanConstTrue:
      type: boolean
      const: true
    IntegerConstOne:
      type: integer
      const: 1

the value of the component BooleanConstTrue._const is the String "true" when it should be boolean true or Boolean.TRUE
the value f the component IntegerConstOne._const is the String "1" when it should be the integer 1
Const values should be the same types as enums with the same value.

This bug blocks downstream users from implementing/using the const keyword data

Can this be fixed? Thanks!

@spacether spacether changed the title 3.1.0 spec processing const with boolean value stored as string rather than boolean/Boolean 3.1.0 spec processing const with boolean/integer value stored as string rather than boolean/Boolean Aug 21, 2023
@spacether spacether changed the title 3.1.0 spec processing const with boolean/integer value stored as string rather than boolean/Boolean 3.1.0 spec processing const with boolean/integer value stored as string rather than boolean/Boolean/integer/Integer Aug 21, 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

1 participant