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

Use IriConverter without output with new attribute #3224

Conversation

FabienSalles
Copy link

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
License MIT
Doc PR api-platform/docs#...

Allow to have content-location without output if output is set to false and set_content_location (the new attribute) is set to true
#hackdayparis

Allow to have content-location without output if output is set to false
and set_content_location is set to true
 #hackdayparis
@FabienSalles FabienSalles force-pushed the content-location-without-output branch from 81b3e1a to fdebcac Compare October 30, 2019 21:59
@dunglas
Copy link
Member

dunglas commented Oct 31, 2019

This attribute must also be added to https://github.com/api-platform/core/blob/master/src/Annotation/ApiResource.php#L69 for the Developer Experience. Sorry I forgot about that yesterday :(. Could you add it please?

@soyuka
Copy link
Member

soyuka commented Nov 1, 2019

@dunglas isn't this a fix though?

@dunglas
Copy link
Member

dunglas commented Nov 1, 2019

No it's a new feature.

@FabienSalles
Copy link
Author

This attribute must also be added to https://github.com/api-platform/core/blob/master/src/Annotation/ApiResource.php#L69 for the Developer Experience. Sorry I forgot about that yesterday :(. Could you add it please?

it is only for documentation purpose ?

Currently, without any modification I can use the attribute for all operations like this :

/** 
 * @ApiResource(
 * attributes={"set_content_location"=true},
 * output=false
 * )
 */

Or for a specific operation like this :

/**
 * @ApiResource(
 * collectionOperations={
 * "post"={"set_content_location"=true}
 * },
 * output=false
 * )

If I declare the attribute as annotation, the declaration could change and it will be logic (I think) to use the attribute like this :

/** 
 * @ApiResource(
 * set_content_location=true,
 * output=false
 * )
 */

But I didn't find a way to retrieve the value with this declaration and the method getOperationAttribute used in the WriteListener class

@FabienSalles
Copy link
Author

FabienSalles commented Nov 2, 2019

Another observation : every attributes annotated are in camelCase so if I have to add it and use it differently, I should convert it to camelcase ?

And, given that the content-location will be set only for write actions by the WriteListener, I would have preferred to change set to write like write_content_location or writeContentLocation

Base automatically changed from master to main January 23, 2021 21:59
@alanpoulain
Copy link
Member

Should we update this PR @dunglas? It would great to have a use case (a PR in the docs would be nice).

@stale
Copy link

stale bot commented Nov 4, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Nov 4, 2022
@stale
Copy link

stale bot commented Jan 3, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 3, 2023
@stale stale bot closed this Jan 10, 2023
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.

4 participants