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

AddProduct, AddProductType, and AddCategory fail (possibly bad error message) #17

Closed
IslandUsurper opened this issue Jul 15, 2015 · 5 comments
Labels

Comments

@IslandUsurper
Copy link
Contributor

Whenever I try to use the ProductResource::addProductAsync() or ProductTypeResource::addProductTypeAsync() methods, I get an error message saying "Product can not be null" or "Value can not be null" respectively. I have verified that I am passing a non-empty Product or ProductType object to those methods as appropriate, even going so far as to inspect the curl set up functions with a debugger, so I have no idea why it would be giving that error message.

When I dumped my requests to JSON files and used curl from the command line, I got errors about specific fields being empty when they shouldn't be. Considering that the documentation doesn't actually tell me what fields are required, that makes sense. So I don't know if all POST methods don't work in the SDK or if it is just returning an unhelpful error message.

@IslandUsurper IslandUsurper changed the title AddProduct and AddProductType fail (possibly bad error message) AddProduct, AddProductType, and AddCategory fail (possibly bad error message) Jul 17, 2015
@IslandUsurper
Copy link
Contributor Author

It's starting to look like none of the addFoo() methods work. I started trying to add Categories and got a similar message:

Mozu\Api\ApiException: Validation Error: Value can not be null. in Mozu\Api\MozuClient->validateResponse() (line 263 of src/MozuClient.php).

After getting the JSON request, I tried sending it through curl on the command line. I got "Validation Error: Description: The field Description must be a string or array type with a maximum length of '500'.", so then I changed my category's description to be shorter and verified that it worked. I deleted the category in the sandbox so I could try again with the SDK. Even though the request object was well-formed, I got "Value can not be null." again.

I can't tell if the problem is in MozuClient or Guzzle's Psr7 package, or what, but unless something changes, no one can use this SDK for projects more interesting than "list what I have in Mozu already".

@sanjaymandadi
Copy link
Contributor

Can you provide a sample of the call you are doing ?

@IslandUsurper
Copy link
Contributor Author

There's a lot, even for a simple call because I'm adding in the authentication, so here's a gist.

@sanjaymandadi
Copy link
Contributor

Thanks for the sample...i am looking into the issue

@sanjaymandadi
Copy link
Contributor

Issue has been fixed in 1.17.2 release. issue was with content-length missing in guzzle request, causing guzzle to default to transfer-encoding: chucked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants