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

Fix for POST/PUT/PATCH calls without bodies #633

Open
wants to merge 26 commits into
base: master
Choose a base branch
from

Conversation

igorsantos07
Copy link

Those calls may be made only with path or query params, and still they fail validation because JSON refuses to decode an empty string.

By the way, by reading Restler::getRequestData() I see that DELETE calls do not accept body params? I know this seems uncommon, but is it correct? An API might want to include further filters in the body to allow the deletion to happen.

diversen and others added 26 commits September 7, 2015 15:21
Fix for Notice: array to string conversion on AutoLoader.php line 266
Removing unwanted unicode character from documentation
…c/examples/_007_crud/DB/Session.php on line 58
…ises decoding by avoiding Obj::toArray() Closes#621
Update to try fixing when a string is expected Validator.php
Remove curly brace syntax for PHP 7.4 support
Those calls may be made only with path or query params, and still they fail validation because JSON refuses to decode an empty string.
@richardeaxon
Copy link
Contributor

Think this patch is stale as this fix is in 3.1.0 -

public function decode($data)
:

public function decode($data)
{
    if (empty($data)) {
        return null;
    }

@Arul-
Copy link
Member

Arul- commented Jan 2, 2021

You are right @richardeaxon!

@Arul- Arul- closed this Jan 2, 2021
@igorsantos07
Copy link
Author

Ok, so....

  1. I guess this should be reopened so I can redirect the PR into 2.2 branch, as this was an issue I had at the time.
  2. Is there a 3.x stable version already? Why isn't it documented anywhere? I thought the project was pretty much dead!

@Arul- Arul- reopened this Jan 4, 2021
@Arul-
Copy link
Member

Arul- commented Jan 4, 2021

@igorsantos07 reopened the pull request. Yes 3.1 is stable and I didn't do a good job documenting it that way.

Also, there is a newer version of restler at https://github.com/Arul-/reactive-restler which will be brought to this repository soon!

@Arul-
Copy link
Member

Arul- commented May 20, 2021

@igorsantos07 can you change it to point to v2 branch?

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.

10 participants