Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Copy link
Copy link
@ntark

Description

@ntark
Issue body actions

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

Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.