question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Proposal: Querystring in Path Specification

See original GitHub issue

Issue

In some APIs, different query string values specifies the operation done on the resource, thus, result in dramatically different response types and/or parameter requirements. In the case of Foursquare Venues Search API, depending on the intent query string value, the requirement specs of other query string vary.
Such distinction deserves a separate path entity, to allow different descriptions, parameter requirements, responses, etc.

Current State

Currently due to Swagger Spec, on swagger-ui, the generated url for testing is incorrect if a query string is included in the path.

"paths": {
    "/bluelights?query=nearby": {

becomes: .../bluelights?query=nearby?more=...

Proposal

Allow Query Strings in the path key

The example above is allowed. so for example, depending on the path key, "/bluelights?query=nearby" and "/bluelights" are considered separate path entities.

Issue Analytics

  • State:open
  • Created 9 years ago
  • Reactions:16
  • Comments:29 (10 by maintainers)

github_iconTop GitHub Comments

8reactions
zdilacommented, Jun 4, 2015

+1

In our case we need it for POST to execute 4 various security actions:

  • /v1/security/credentials?action=changePassword
  • /v1/security/credentials?action=requestPasswordReset
  • /v1/security/credentials?action=resetPassword
  • /v1/security/credentials?action=remindUsername

Every action is implemented as different method with different POST body.

We don’t want to distinguish actions by path (eg. /v1/security/credentials/changePassword) because paths should be nouns, not verbs.

7reactions
darrelmillercommented, Sep 16, 2016

@davidnewcomb I agree that using only the path to identify the resource is a nice simplification that is sufficient for most cases. However, a significant number of people come to OpenAPI to try and document an existing API. We have to balance encouraging good practices with being compatible with the wide range of ways HTTP APIs are implemented.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to define different query parameters for same path in ...
I want my OpenAPI YAML file to document these two query params separately. Is this possible?
Read more >
Describing Parameters - Swagger
Query parameters can be primitive values, arrays and objects. OpenAPI 3.0 provides several ways to serialize objects and arrays in the query string....
Read more >
The History of the URL: Path, Fragment, Query, and Auth
Their proposal was itself painfully shortsighted, led to the attempt to introduce a Set-Cookie2 header, and introduced fundamental structural issues we still ...
Read more >
RFC 1738: Uniform Resource Locators (URL)
The specification of URLs is designed to meet the requirements laid out in "Functional ... <path> is an HTTP selector, and <searchpart> is...
Read more >
x-amazon-apigateway-integration.requestParameters object
<param-name> format, where <param-type> can be querystring , path , header , or ... header ( x-user-id ), and path ( service )...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found