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

Allow custom operations to return a different class than the expected resource class #2861

Conversation

teohhanhui
Copy link
Contributor

@teohhanhui teohhanhui commented Jun 14, 2019

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #2855, api-platform/api-platform#1172
License MIT
Doc PR N/A

@teohhanhui teohhanhui force-pushed the fix/custom-operation-return-different-class branch from b2c623b to 5af92ed Compare June 14, 2019 15:35
@bendavies
Copy link
Contributor

this obviously begs the question, what is $strict even for?

@teohhanhui teohhanhui force-pushed the fix/custom-operation-return-different-class branch 3 times, most recently from db0a45d to a7433d4 Compare June 14, 2019 16:53
@teohhanhui teohhanhui force-pushed the fix/custom-operation-return-different-class branch from a7433d4 to 9223ebb Compare June 17, 2019 13:52
/**
* @var string
*/
private $amount;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not mapped as Doctrine MongoDB ODM does not have a decimal type. I'm not sure what's the right thing to do here... If I use type="float", the type validation fails during denormalization.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -2,10 +2,13 @@ Feature: Custom operation
As a client software developer
I need to be able to create custom operations

Background:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh this is nice, does this allow to add steps to every scenario?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah.

Copy link
Member

@soyuka soyuka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the strict parameter still used?

@teohhanhui
Copy link
Contributor Author

Is the strict parameter still used?

No. But I don't think we should deprecate it either? There are tests that use it so it's at least covered.

@soyuka
Copy link
Member

soyuka commented Jun 21, 2019

No. But I don't think we should deprecate it either? There are tests that use it so it's at least covered.

Hmm yeah leave it like this, at first I thought that this class was @internal.

@soyuka soyuka merged commit f94b329 into api-platform:2.4 Jun 21, 2019
@teohhanhui teohhanhui deleted the fix/custom-operation-return-different-class branch June 21, 2019 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants