Rinat
Rinat

Reputation: 429

Is it possible to use whole raw string as parameter in swagger

there is a url like http://someservice.com/confirm?{token}

Is this any way how to describe this endpoint in terms of swagger notation

if use as query parameter then you get

  /confirm:
    get:
      summary: ...
      parameters:
        - in: query
          name: token
        ...

http://someservice.com/confirm?token=value that is not OK

from other side it is not possible to use url notation in follow way:

  /confirm?{token}:
    get:
      summary: ...
      parameters:
        - in: path
          name: token
        ...

due to query strings in paths are not allowed.

Upvotes: 2

Views: 658

Answers (1)

Helen
Helen

Reputation: 97599

This is currently not supported, neither in OpenAPI 2.0 nor in OpenAPI 3.0. Here's the corresponding feature request:

Support for arbitrary query strings

Upvotes: 1

Related Questions