Skip to content

Format "date" with "required" generates invalid mock with msw #2580

@trumppk

Description

@trumppk

When generating a type

    MyType:
      type: object
      required:
        - id
        - myDate
      properties:
        id:
          type: string
        myDate
          type: string
          format: date

Then the generated msw code contains an mock with invalid type:

              Types of property 'myDate' are incompatible.
                Type 'string | undefined' is not assignable to type 'string'.
                  Type 'undefined' is not assignable to type 'string'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    mswMSW related issuesworkaroundA workaround has been provided

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions