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

Merge keys are handled incorrectly in SwaggerUI view #283

Open
lfyuomr-gylo opened this issue Aug 2, 2019 · 0 comments
Open

Merge keys are handled incorrectly in SwaggerUI view #283

lfyuomr-gylo opened this issue Aug 2, 2019 · 0 comments

Comments

@lfyuomr-gylo
Copy link

Consider the following OpenAPI definition, containing YAML Merge keys with anchor references:

openapi: 3.0.0
info:
  title: "Merge keys sample"
  description: "This is a sample OpenAPI specification with YAML Merge Keys feature used."
  version: snapshot

components:
  schemas:
    SelectionOption: &SelectionOption
      type: object
      required:
        - id
        - label
      properties:
        id:
          type: string
          nullable: false
          description: An internal unique identifier, which should be used for any communication with the backend.
        label:
          type: string
          nullable: false
          description: A human-readable name which should be shown to a user instead of the `id`.
          readOnly: true

paths:
  /foo/bar:
    get:
      summary: Blah blah
      responses:
        200:
          description: Blah blah
          content:
            application/json:
              schema:
                type: object
                properties:
                  foo:
                    <<: *SelectionOption
                    description: "This is description of `foo` field"
                  bar:
                    <<: *SelectionOption
                    description: "Here is description of bar field"

If I open this definition in my IntelliJ and then click open in browser button, I get a SwaggerUI page with wrong response schema:
image

It seems like the Merge key is just ignored in my OpenAPI definition, even though it's handled properly both by editor.swagger.io and by SwaggerUI 3.22.3:
image

I suppose it could be related to #87 and may be caused by the well-known Jackson limitation.


My environment:

  • IntelliJ IDEA 2019.2
  • Swagger plugin v 1.0.27
  • Google Chrome 70.0.3538.77 (64-bit) for Linux
@lfyuomr-gylo lfyuomr-gylo changed the title Merge keys are handled incorrectly Merge keys are handled incorrectly in SwaggerUI view Aug 2, 2019
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

1 participant