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

[ResourceBundle] Api request should not return RedirectResponse #1677

Merged
merged 1 commit into from
Jul 4, 2014

Conversation

arnolanglade
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
BC breaks? possible
Deprecations? no
Fixed tickets -
License MIT
Doc PR -

The delete, create and update actions return a RedirectResponse, we lost some advantages of the FosRestBundle.

  • For a deletion, if you want to send a response with empty body (see empty_content), it is impossible to configure the HTTP code returned.
  • For a update, I got a infinite redirection loop when I tried to update a resource using the PUT method. Moreover, if your client is not a browser, it is possible that it does not support redirect response.

I know that some methods has a lot of return has a lot of return, some developer does not like it but I have not problem with it. I need it ASAP for a project so I am here if you want to talk about this !

@kayue
Copy link
Contributor

kayue commented Jul 2, 2014

👍

@arnolanglade arnolanglade mentioned this pull request Jul 3, 2014
@arnolanglade
Copy link
Contributor Author

@pjedrzejewski updated!

@@ -30,7 +30,8 @@
"friendsofsymfony/rest-bundle": "~1.0",
"jms/serializer-bundle": "~0.12",
"white-october/pagerfanta-bundle": "1.0.*",
"doctrine/doctrine-bundle": "~1.3@dev"
"doctrine/doctrine-bundle": "~1.3@dev",
"willdurand/hateoas-bundle": "@stable"
Copy link
Contributor

Choose a reason for hiding this comment

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

You need to register that bundle in Kernel to be able to use it functionality.

Copy link
Contributor

Choose a reason for hiding this comment

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

This must be added to main composer.json file too.

@pjedrzejewski
Copy link
Member

@Arn0d Could you update composer.lock to include hateoas stuff? Can't see it in the diff. :)

@pjedrzejewski
Copy link
Member

Just run $ composer update package/name.

pjedrzejewski pushed a commit that referenced this pull request Jul 4, 2014
[ResourceBundle] Api request should not return RedirectResponse
@pjedrzejewski pjedrzejewski merged commit f04f13c into Sylius:master Jul 4, 2014
@pjedrzejewski
Copy link
Member

I will do this cause I need it. :D Thanks Arnaud!

@arnolanglade
Copy link
Contributor Author

Sorry, I was doing several things at the same time ! ✌️

@pjedrzejewski
Copy link
Member

No worries! :)

@arnolanglade arnolanglade deleted the fix/api branch December 16, 2014 12:52
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.

None yet

4 participants