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

[V2] Custom operation + deserialization #880

Closed
lyrixx opened this issue Dec 12, 2016 · 3 comments
Closed

[V2] Custom operation + deserialization #880

lyrixx opened this issue Dec 12, 2016 · 3 comments

Comments

@lyrixx
Copy link
Contributor

lyrixx commented Dec 12, 2016

Hello.

My context

I have two entities Env and User. And and env could have members (users).
So I wanted to add a new custom operation.

In this case, it do not need to send a body content, because I can give everything in the URL (api/v2/{env uuid}/add-memeber/{user uuid}). So I would like to be able to disable the automatic deserialization.

Note

I saw in the doc, the following route param are mandatory:
* defaults={"_api_resource_class"=Env::class, "_api_item_operation_name"="add-member"}
But I looked at the code, and actually, it's not really mandatory, because there is a try/catch there

Then, Even if I add theses param, the new operation is not displayed in the doc (swagger)

RFC

Add an option in the route configuration to not enable the automatic deserialization. because sometimes, you don't need it.

@kbsali
Copy link

kbsali commented Dec 12, 2016

@dunglas @teohhanhui sounds familiar! ;)
@lyrixx we also had that very same need (see #781) and provided a PR : #782 (thanks @gpenverne ) which has been moved to #805 ...

I would therefore consider this as a "WIP duplicate"!

@dunglas
Copy link
Member

dunglas commented Dec 12, 2016

The route option looks like a good solution to me.

@Simperfit
Copy link
Contributor

I think this has been fixed, @lyrixx if it's not feel free to ping me

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