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

support property example #901

Merged
merged 7 commits into from
Nov 15, 2023

Conversation

kuei0221
Copy link
Contributor

[WHY]

  • The generated swagger JSON didn't include the example for the response. This will be useful when the user wants to know the response example, this will help them to understand the API quicker.

[HOW]

  • add a new option for the params description ex to provide an example for the specific parameters

Here is a swagger editor preview with the ex option, which correctly shows the example in response:
image

[WHY]
* the generated swagger json didn't include the example for the response

[HOW]
* add a new option for params description `ex` to provided example for the specific parameters
Copy link
Contributor

@PanosCodes PanosCodes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work 🚀 Thank you for working on it 🙏 example is indeed a valid swagger attribute.

Perhaps the options can be named example? Do you know if there was a reason not to do that?

Co-authored-by: Panos Dalitsouris <22100396+PanosCodes@users.noreply.github.com>
@mathieujobin mathieujobin added the Next up consider for upcoming release or close label Nov 1, 2023
Copy link
Contributor

@PanosCodes PanosCodes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you maybe add a reference to README too?

lib/apipie/generator/swagger/param_description/builder.rb Outdated Show resolved Hide resolved
@kuei0221 kuei0221 requested a review from PanosCodes November 10, 2023 09:22
@mathieujobin mathieujobin merged commit 05e3e0e into Apipie:master Nov 15, 2023
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Next up consider for upcoming release or close
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants