swagger-api / swagger-api/swagger-ui

OAS 3.0: Rendering "additionalProperties: true" and "additionalProperties: {}" in Models

Open
#3,523 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

specification: 3.x type: discussion type: enhancement version: 3.x
Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

Description

Version: 3.1.2

When additionalProperties contains a specific schema, e.g.

type: object
additionalProperties:
  type: integer

the Models section displays this:

additionalProperties - integer

but the following schemas

type: object
additionalProperties: true
type: object
additionalProperties: {}

does not indicate that the object may have additional properties:

image

Should it maybe display something like < * > : * or < * > : any value or similar?

Full spec:

openapi: 3.0.0
info:
  title: test
  version: 0.0.0
paths: {}
components:
  schemas:

    StrToIntDictionary:
      type: object
      additionalProperties:
        type: integer
        
    FreeFormObject:
      type: object
      additionalProperties: true

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the provided OpenAPI 3.0 full spec and inspect the Models rendering for schemas using additionalProperties: true and additionalProperties: {}. Compare it with the displayed integer-schema case; done means both free-form schemas visibly indicate that additional properties may contain any value, with the chosen wording or notation covered by the relevant rendering behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, openapi
Domain
documentation, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.