scalar / openapi-parser

Modern OpenAPI parser written in TypeScript
MIT License
34 stars 1 forks source link

parsing removes the port from servers #59

Closed marclave closed 6 months ago

marclave commented 6 months ago

What happens?

passing in this url results in the parsed version dropping the port

spec: url: "http://localhost:5062/" parsedSpec: url: "http://localhost/"

What did you expect to happen?

keeps the port

parsedSpec: url: "http://localhost:5062/"

How can we reproduce the issue?

set

...
servers: [{url: 'http://localhost:5062/' }]
...

Swagger/OpenAPI Example

No response

hanspagel commented 6 months ago

When I test this with just the @scalar/openapi-parser package the output is correct:

Input

{
  "openapi": "3.1.0",
  "info": {
    "title": "Hello World",
    "version": "1.0.0"
  },
  "servers": [{"url": "http://localhost:5062/"}],
  "paths": {}
}

Output

{
  "openapi": "3.1.0",
  "info": {
    "title": "Hello World",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "http://localhost:5062/"
    }
  ],
  "paths": {}
}
hanspagel commented 6 months ago

Looks good in scalar/scalar@main, too.

Looks good in the sandbox, too: https://sandbox.scalar.com/e/oL3wX

Can’t reproduce it. 🤔 Maybe we fixed this already?