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

[Schema Inaccuracy] Fields not marked as required #118

Open
cipriancaba opened this issue Nov 3, 2023 · 0 comments
Open

[Schema Inaccuracy] Fields not marked as required #118

cipriancaba opened this issue Nov 3, 2023 · 0 comments

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

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