jhthorsen / mojolicious-plugin-openapi

OpenAPI / Swagger plugin for Mojolicious
54 stars 42 forks source link

Root path in generated json spec is incorrect #174

Closed plk closed 4 years ago

plk commented 4 years ago

In think, since 3.30, I see this issue. Using Swagger UI to load a YAML spec:

https://swaggerui/?url=https://prod:3000/v1.json

with this in the spec:

`` servers:

results in a spec being generated by the plugin and loaded by Swagger UI that looks like this:

`` servers:

This breaks all "Try it Out" curl URLs due to the added ".json" - seems to be using the URL used to call the API as root instead of the spec root?

jhthorsen commented 4 years ago

The easiest fix is simply to omit the ".json" extension. Why do you include it?

plk commented 4 years ago

It's been like that for a few years - I believe that this was in the docs at one point as the correct URL to get at the spec.