Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser doesn't resolve object to MapSchema #1071

Closed
ackintosh opened this issue Apr 6, 2019 · 3 comments
Closed

Parser doesn't resolve object to MapSchema #1071

ackintosh opened this issue Apr 6, 2019 · 3 comments

Comments

@ackintosh
Copy link
Contributor

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. 😉

@gracekarina
Copy link
Contributor

Hi @ackintosh thanks for the report, we have merged a PR, that solved the issue, please let us know if this issue keeps happening.

@ackintosh
Copy link
Contributor Author

@gracekarina Thanks for the fix. 👍

@frantuma
Copy link
Member

Fixed by #1077 and #1082

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants