Skip to content

"Additional properties false" added to every object in schema in UI when switching to OpenAPI 3.1 #2619

Description

@ntark

Describe the bug
After switching to OpenAPI 3.1 I am seeing "Additional properties false" added to every root/nested object in schema

OpenApi File To Reproduce

{
  "openapi": "3.1.1",
  "info": {
    "title": "API",
    "version": "1"
  },
  "paths": {
    "/": {
      "get": {
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BooleanModelResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "BooleanModel": {
        "type": "object",
        "properties": {
          "showBanner": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "BooleanModelResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/BooleanModel"
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {}
  },
  "security": [],
  "tags": []
}

Expected behavior
Additional properties false property not part of schema in UI

Image

Actual behavior
Additional properties false property part of schema in UI

Image

Additional context
Pasting provided sample swagger.json file into (I believe) official generator yields exact same behavior. ( Changing version to "openapi": "3.0.6" hides Additional proerties forbidden field).

Is there any way to prevent "additionalProperties": false from being added to generated swagger.json?
Or is that the correct and expected behavior?

Linked Issue

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions