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.

Ordering operations not working with various url path

See original GitHub issue

Hi,

Following the issue raised here: https://github.com/apideck-libraries/portman/issues/423 I found that there is indeed a minimal reproductible case when we have 2 http requests without any folder:

GET /users/
POST /users/search

Here is the following openAPI yaml corresponding to that:

openapi: 3.0.0
info:
  title: Sample API
  description: Sample desc
  version: 0.1.9
servers:
  - url: http://api.example.com/v1
    description: Optional server description, e.g. Main (production) server

paths:
  /users:
    get:
      summary: Returns a list of users.
      responses:
        '200':
          description: A JSON array of user names
          content:
            application/json:
              schema: 
                type: array
                items: 
                  type: string
  /users/search:
    post:
      summary: search for user
      responses:
        '201': 
          description: A JSON array of searched user names
          content:
            application/json:
              schema: 
                type: array
                items: 
                  type: string

Given the following portman config yaml:

{
  "version": 1.0,
  "tests": {},
  "globals": {
    "orderOfOperations": ["GET::/users/", "POST::/users/search"]
  }
}

I would expect to have the GET operation performed before the POST one. However, the generated collection has the the POST request before the GET, it is confirmed whenever newman is running it:

→ search for user
  POST https://api.toto.com/users/search

→ Returns a list of users.
  GET https://api.toto.com/users 
Collection run completed.

Is there any workaround that could exist ? I could put a tag but this does not really scale when we have like > 20 requests

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
laurent-lemkecommented, Nov 6, 2022

Gosh yes it totally did, thanks for helping me to notice that !

0reactions
thim81commented, Nov 6, 2022

@laurent-lemke If the above explanation helped you solve your issue, could you please close the item? Otherwise we will auto-close it after 7 days?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Django URL order - pycharm - Stack Overflow
Using the URLconf defined in pyshop.urls, Django tried these URL patterns, in this order: admin/ products/ The empty path didn't match any of ......
Read more >
URL maps overview | Load Balancing - Google Cloud
How URL maps work; Naming; URL map components. Order of operations; Path matcher constraints; URL maps and protocols; Simplest URL map.
Read more >
Different approaches to HTTP routing in Go - Ben Hoyt
My goal here is to route the same 11 URLs with eight different approaches. These URLs are based on a subset of URLs...
Read more >
URL Dispatch - Actix
URL dispatch provides a simple way for mapping URLs to handler code using a simple pattern matching language. If one of the patterns...
Read more >
HTTP Request Methods – Get vs Put vs Post Explained with ...
In this article, we'll be discussing the get, put, and post HTTP methods. You'll learn what each HTTP method is used for as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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