Skip to content

[Schema Inaccuracy] Fields not marked as required #118

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

Open
cipriancaba opened this issue Nov 3, 2023 · 1 comment
Open

[Schema Inaccuracy] Fields not marked as required #118

cipriancaba opened this issue Nov 3, 2023 · 1 comment

Comments

@cipriancaba
Copy link

Schema Inaccuracy

The response fields are not marked as required thus creating | undefined types in code generation tools

Expected

For example, the tag definition:

 tag:
      title: Tag
      type: object
      x-tags:
      - Tags
      description: A tag allows you to label your contacts, companies, and conversations
        and list them using that tag.
      properties:
        type:
          type: string
          description: value is "tag"
          example: tag
        id:
          type: string
          description: The id of the tag
          example: '123456'
        name:
          type: string
          description: The name of the tag
          example: Test tag
        applied_at:
          type: integer
          format: date-time
          description: The time when the tag was applied to the object
          example: 1663597223
        applied_by:
          "$ref": "#/components/schemas/reference"

should be:

tag:
      title: Tag
      type: object
      x-tags:
      - Tags
      description: A tag allows you to label your contacts, companies, and conversations
        and list them using that tag.
      properties:
        type:
          type: string
          required: true
          description: value is "tag"
          example: tag
        id:
          type: string
          required: true
          description: The id of the tag
          example: '123456'
        name:
          type: string
          required: true
          description: The name of the tag
          example: Test tag
        applied_at:
          required: true
          type: integer
          format: date-time
          description: The time when the tag was applied to the object
          example: 1663597223
        applied_by:
          required: true
          "$ref": "#/components/schemas/reference"

Reproduction Steps

Please see attached conversation
openapi-ts/openapi-typescript#1422 (comment)

And repro repo
https://github.com/cipriancaba/openapi-typescript

@scorpp
Copy link

scorpp commented May 6, 2025

Still not fixed

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

2 participants