Skip to content

Unable to use swagger_context in subresource #1873

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

Closed
jeffreymb opened this issue Apr 16, 2018 · 5 comments
Closed

Unable to use swagger_context in subresource #1873

jeffreymb opened this issue Apr 16, 2018 · 5 comments

Comments

@jeffreymb
Copy link
Contributor

I have a subresource definition on a DTO class as follows:

 *     subresourceOperations={
 *          "chapters_get_subresource"={
 *              "path"="bibles/{version}/books/{book}/chapters",
 *              "swagger_context"={
 *                  "parameters"={
 *                      {"name"="version", "in"="path", "type"="string", "required"=true},
 *                      {"name"="book", "in"="path", "type"="string", "required"=true},
 *                  },
 *              },
 *          },
 *     },

The swagger_context has no effect in the swagger UI. Am I doing something wrong or is this a bug?

@Simperfit Simperfit added the bug label Apr 16, 2018
@soyuka
Copy link
Member

soyuka commented Apr 17, 2018

example: https://github.com/gries/api-platform/pull/1/files#diff-03658d5f5162523638fa095aac8fb995R21

This is not a subresource but should be a custom collection operation IMHO.

@jeffreymb
Copy link
Contributor Author

Perhaps you are correct that this should be a custom collection operation instead of a subresource, but the bug remains that it isn't currently possible to set a custom swagger context in a subresource.

@soyuka
Copy link
Member

soyuka commented Apr 17, 2018

Indeed swagger_context is missing here. Although I'm not sure that we should support this because you shouldn't need it and do a custom operation instead :).

@soyuka
Copy link
Member

soyuka commented Apr 7, 2019

merging with #2706

@brunonic
Copy link

brunonic commented Sep 1, 2020

In my case, I need to change my subresource operation tags in swagger, it's not possible now and this is not cool.

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

4 participants