Skip to content

Allow to disable input and output class #2393

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

Merged
merged 1 commit into from
Dec 19, 2018

Conversation

dunglas
Copy link
Member

@dunglas dunglas commented Dec 18, 2018

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets n/a
License MIT
Doc PR api-platform/docs#703

This PR allows to set the new input_class and output_class attributes to false. It hints API Platform that the corresponding operation(s) will respectively expect an empty input, or will return nothing.

This is especially convenient when creating an endpoint that will return nothing. My use case: I create have a POST /reset-password endpoint that sends a token by mail. This endpoint returns 202 Accepted and nothing else.

The next step will be to support input_class and output_class (including this new option) in the documentation normalizers.

@soyuka
Copy link
Member

soyuka commented Dec 19, 2018

Good idea!

@dunglas dunglas merged commit cf7fd3f into api-platform:master Dec 19, 2018
@dunglas dunglas deleted the false_in_out branch December 19, 2018 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants