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

feature request - examples extension #708

Closed
hrvoj3e opened this issue Mar 28, 2022 · 1 comment
Closed

feature request - examples extension #708

hrvoj3e opened this issue Mar 28, 2022 · 1 comment

Comments

@hrvoj3e
Copy link

hrvoj3e commented Mar 28, 2022

Voting for option to opt-in showing summary or keys or both.
Maybe is ugly for default usage but for specific use cases it is really helpful.

Here is an example

in: query
name: id
schema:
  type: integer
  format: int32
  minimum: 10000
examples:
  empty: ## just an empty value ## fixes auto filling example
    value:
  demo-1:
    value: 10101
  canceled-order:
    value: 10102
  order-with-discount:
    value: 10103
  order-with-discount-2:
    value: 10104
    summary: there are multiple discount applied

x-examples-summary-show: title
x-examples-key-show: true

Showing 10101 | 10102 | 10103 | 10104 to user is not helpful.
But showing demo-1 | canceled-order | order-with-discount | order-with-discount is useful and clear what that example will show.

Also, if you could find some place to display summary after user clicks on one example - that would be great.

x-examples-key-show: true
x-examples-summary-show: selected # when seelcted only
# or
x-examples-summary-show: title # show on hover (this should be default: true)

Example - swagger

Also there is similar request

@hrvoj3e hrvoj3e changed the title feature request - examples entension feature request - examples extension Mar 28, 2022
@mrin9 mrin9 closed this as completed in 54a3545 Mar 31, 2022
@mrin9
Copy link
Collaborator

mrin9 commented Mar 31, 2022

use use-summary-to-list-example = true to list example summary instead of value (default is false)

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

2 participants