Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Endpoint not relative to base url #1529

Closed
jasonetwork opened this issue Jun 30, 2019 · 2 comments
Closed

Endpoint not relative to base url #1529

jasonetwork opened this issue Jun 30, 2019 · 2 comments

Comments

@jasonetwork
Copy link

api_ss

So, here's an issue I am encountering. I'm in the process of developing an API, but I'm having issues with the base url and endpoint "path". The endpoint is not relative to the base url. In my example above, since the base url contains /v1/partner, then the endpoint should simply be /contacts and not /v1/partner/contacts. I'm fully aware that I could simply remove /v1/partner from the base url and it would be technically correct, but frankly, this is ugly and not visually appealing for end users. I don't want each of my endpoints to display this prefix when it's already included in the base url. It's absolutely unnecessary for each endpoint to be prefixed with /v1/partner when it could simply be stated in the base url.

I've tried messing with the configuration, but have had no luck. It appears to me that the "host" and "basePath" settings in nelmio_api_doc.yaml are just for display purposes and serves no other purpose than to display the base url in the documentation. Wouldn't it make sense to be able to define a "basePath" which would then allow your endpoints to be relative to this path?

So, what am I missing? Is there actually any way to allow my base url to include /v1/partner and my endpoint to simply be /contacts?

@GuilhemN
Copy link
Collaborator

GuilhemN commented Jul 9, 2019

basePath is an option the bundle uses when symfony's root is not / but it doesn't support setting it manually for now.

Allowing that would require a post processing describer removing the base path from all URLs imo, PR welcome if you're willing to implement that :)

@chrisguitarguy
Copy link
Collaborator

Goign to close this due to age, but we can reopen if this is a feature more folks want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants