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

Allow ApiResponse.reference to be set as Schema.$ref in json and yaml #884

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jonkeda
Copy link

@jonkeda jonkeda commented Nov 2, 2022

Hi Chen Kong,

Would you please have look at the changes I made? And consider if you can merge them?

It is meant to render the "reference" of an apiresponse to the json as a $ref field.

For instance in this example I added a reference:

_@ApiResponses(value = {@ApiResponse(code = 400, message = "Invalid pet value", reference = "https://pet.error.com")})_

And it is rendered as following:

    _"responses": {
      "400": {
        "description": "Invalid pet value",
          "schema" : {
              "$ref" : "https://pet.error.com"
          }
      }
    },_

I made the changes in the reader and changed one endpoint to test. All affected unit tests have been modified.

Kind regards,
Daan Jonkers

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

Successfully merging this pull request may close these issues.

1 participant