Tobion / OpenAPI-Symfony-Routing

Loads routes in Symfony based on OpenAPI/Swagger annotations
MIT License
41 stars 5 forks source link

Add support for OpenAPI basePath/servers #3

Open Tobion opened 4 years ago

Tobion commented 4 years ago

https://swagger.io/docs/specification/2-0/api-host-and-base-path/

the basePath should be added to the route path. It should be possible to also disable this in case the basePath should not be part of the Symfony app as it's done via URL rewrite for example.

Tobion commented 3 years ago

In OpenApi v3 the equivalent is servers.url. but there can be multiple servers and the url can also contain the host and placeholders. and the servers can be overwritten at the path level. so we would need to extract the path from the url and decide which server to use (or probably only do this when there is only a single server or check if all servers have the same path)