Skip to content

null example value leads to incorrect example JSON #997

@brunchboy

Description

@brunchboy

If we have an attribute in our response defined as follows:

          "providerExpiration": {
            "type": "string",
            "description": "When this provider (account) is configured to expire, if ever",
            "format": "date-time",
            "example": null
          }

the resulting example created by Rapidoc is invalid, it is missing a comma after the null:

"name": "Jackson Doe",
"providerExpiration": null
"providerId": "18d1dc35-0d80-4000-8734-63dfdee46d01",

If we remove the setting of the example value to null, a random timestamp is generated and rendered correctly with a subsequent comma:

"name": "Jackson Doe",
"providerExpiration": "1970-01-01T00:00:00.000Z",
"providerId": "18d1dbc3-b530-4000-82b9-f53653214a01",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions