Skip to content

Use names for query string parameter examples #295

@waldyrious

Description

@waldyrious

The support for query string examples introduced in 9f2fa93 as a fix to #269 seems to use the value of the examples, rather than the name (if they have one, e.g. when using examples instead of example).

For instance, say I have this parameter:

parameters:
  - name: q
    in: query
    description: A search query to filter the returned items
    schema:
      type: string
    examples:
      'Filter by prefix':
        value:
          prefix:foobar
      'Limit number of returned items':
        value:
          limit:20

Here's what RapiDoc shows:
Screenshot 2020-09-03 at 11 40 43

And here's what I'd expect to see instead:
Screenshot 2020-09-03 at 11 44 08

(Especially since the content of the example is already shown in the text box, so it's just redundant to show it also in the link label.)

I realize that the examples added in 9f2fa93 use generic names like example1, example2, etc., but since the examples field of OpenAPI parameter objects contains a map, where the keys can be arbitrary strings, it would make sense to assume the names are semantically valid.

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