PaloAltoNetworks / docusaurus-template-openapi-docs

Docusaurus template for bootstrapping with docusaurus-openapi-docs
MIT License
9 stars 16 forks source link

All openapy fields marked as required even when they are not #6

Open developer-betandeal opened 7 months ago

developer-betandeal commented 7 months ago

Describe the bug

After generating the pages for openapi.yaml that doesn't mark as required the fileds for some object, all the attributes are marked as "required"

Expected behavior

Not mark as Required all non required attributes for schema

Current behavior

All the attributes are marked as required

Steps to reproduce

openapi.yaml:

      properties:
        error:
          type: string
        status:
          type: string
          enum:
            - ok
            - ko
      required:
        - status
      additionalProperties: false

Generated html:

<ul style="margin-left: 1rem;"><div class="openapi-schema__list-item"><div><span class="openapi-schema__container"><strong class="openapi-schema__property">error</strong><span class="openapi-schema__name"> string</span><span class="openapi-schema__required">required</span></span></div></div><div class="openapi-schema__list-item"><div><span class="openapi-schema__container"><strong class="openapi-schema__property">status</strong><span class="openapi-schema__name"> string</span><span class="openapi-schema__divider"></span><span class="openapi-schema__required">required</span></span><div><p><strong>Possible values:</strong> [<code>ok</code>, <code>ko</code>]</p></div></div></div></ul>

Screenshots

image

image