Skip to content

Allow to disable input and output class#2393

Merged
dunglas merged 1 commit intoapi-platform:masterfrom
dunglas:false_in_out
Dec 19, 2018
Merged

Allow to disable input and output class#2393
dunglas merged 1 commit intoapi-platform:masterfrom
dunglas:false_in_out

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