Skip to content

Falsy example value do not generate comments in output #890

Closed
@vietanhtran16

Description

@vietanhtran16

When we do the below to generate interface from schema, when example value is false, it does not generate the comment for the example value but when example value is true, it does. Could we have an option to allow this or even make it default? Thanks

Schema

openapi: 3.0.3
components:
  schemas:
    Config:
      type: object
      properties:
        IsEnable:
          type: boolean
          example: false // this is the value I am talking about

Expected output

export interface components {
  readonly schemas: {
    readonly Config: {
        /** @example false */
        readonly IsEnable: boolean
    }
  }
}

Actual output

export interface components {
  readonly schemas: {
    readonly Config: {
        readonly IsEnable: boolean // comment is not generated
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    PRs welcomePRs are welcome to solve this issue!bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions