Skip to content

feature request - examples extension #708

@hrvoj3e

Description

@hrvoj3e

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions