docusaurus-openapi-docs icon indicating copy to clipboard operation
docusaurus-openapi-docs copied to clipboard

Schema minimums of 0 are not rendered

Open drwelby opened this issue 2 years ago • 1 comments

Describe the bug

A schema that has a minimum value of 0 is not rendered

Expected behavior

You should see Possible values: [>= 0]

Current behavior

Only non-zero minimums are rendered.

Possible solution

Smells like a truthiness bug.

Steps to reproduce

Add this to any object schema:

minmax:
          type: number
          example: 15
          minimum: 0
          maximum: 50

Only the maximum will render Possible values: [<= 50]

Your Environment

"@docusaurus/core": "^2.4.1",   
"@docusaurus/preset-classic": "^2.4.1",
"docusaurus-plugin-openapi-docs": "^2.0.0-beta.3",
"docusaurus-theme-openapi-docs": "^2.0.0-beta.3",

Reported on multiple browsers.

drwelby avatar Jun 29 '23 15:06 drwelby

I think that's the same issue than here : https://github.com/PaloAltoNetworks/docusaurus-openapi-docs/issues/724 I didn't saw the issue when I created mine ...

I provided a MR to fix this, eventually it will also fix the minimum too.

ImFlog avatar Mar 01 '24 18:03 ImFlog

#754 should have addressed this

sserrata avatar Jun 28 '24 20:06 sserrata