Skip to content

Parser doesn't resolve object to MapSchema #1071

@ackintosh

Description

@ackintosh

From my understanding a object which has additionalProperties should be resolved to MapSchema but it doesn't at the moment.

YAML

...
...
...
paths:
  '/mapschema':
    get:
      description: MapSchema
      operationId: MapSchema
      responses:
        '200':
          description: Successful response.
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: string

The schema is resolved as ObjectSchema instead of MapSchema

OpenAPI result = (new OpenAPIV3Parser()).read("mapschema.yaml");

result.getPaths()
.get("/mapschema")
.getGet()
.getResponses()
.get("200")
.getContent()
.get("application/json")
.getSchema().getClass().getName()
// io.swagger.v3.oas.models.media.ObjectSchema

If my understanding is correct, I'd file a PR to fix it. 😉

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions