Skip to content

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

@developer-betandeal

Description

@developer-betandeal

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions