question

gragra33 avatar image
0 Likes"
gragra33 asked ·

NEW REST API DOCUMENTATION: INVALID JSON SAMPLE

I am looking at working with the new REST API however before I start to dedicate time towards it, I am using the sample responses in the documentation to look at the data returned. Has anyone else noticed that some samples not only don't match the documented definition but also contain **syntax errors in the JSON data**? Here is one example: http://developer.ebay.com/Devzone/rest/api-ref/inventory/inventory_item__get.html#Samples The **Aspect sample data is syntactically incorrect** and does not match the specification here: http://developer.ebay.com/Devzone/rest/api-ref/inventory/inventory_item__get.html#Output "aspects": [ string /* More string nodes here */ ], ref: inventoryItems.product.aspects > array of string *Conditionally This is an array of item specific pairs that provide more information about the product. These item specifics pairs are automatically populated when a seller specifies a Global Trade Item Number (GTIN) or Brand/MPN pair and a product match is found in the eBay product catalog. Max length: 40.* The sample shows: "aspects": [ "Brand": ["GoPro"], "Type": ["Helmet/Action"], "Storage Type": ["Removable"], "Recording Definition": ["High Definition"], "Media Format": ["Flash Drive (SSD)"], "Optical Zoom": ["10x"] ], Also, I have checked the validity of the JSON syntax used by eBay against RFC4627, RFC7159, & EMCA-404 specifications using [ https://jsonformatter.curiousconcept.com][1] & [ http://jsonlint.com][2] & [ http://codebeautify.org/jsonvalidator][3] - all fail. ![alt text][4] Can someone at eBay please explain if the documentation is correct or not and if not please correct it. Once I can see that there are no issues with the documentation / samples, I'll then start investing time in the new REST APIs. Thanks. [1]: https://jsonformatter.curiousconcept.com/ [2]: http://jsonlint.com/# [3]: http://codebeautify.org/jsonvalidator [4]: /storage/temp/1130-aaa-invalid-json.jpg
rest apibug reporterrorsdocumentation
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

simocheste_0 avatar image
0 Likes"
simocheste_0 answered ·
Is there any update to this issue? I have run into the same issue 4 months after it was reported and the sample JSON is still wrong in the documentation.
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

gragra33 avatar image
0 Likes"
gragra33 answered ·
@curtis_developerprogram Thanks for the quick response. I'll look back at the sample once it is updated and check it again. Graeme
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

curtis_developersprogram avatar image
0 Likes"
curtis_developersprogram answered ·
@gragra33 Thanks for bringing this to our attention. I see that the first issue is coming from a payload model. The payload models in the documentation are intended to show all possible fields and give a sense of the structure for a given request or response payload. The payload models are showing the hierarchy of the resources and identifying types and data types in use. Because of the callouts for types (e.g., /* InventoryItem */) these are, as you note, not valid JSON, but we used JSON-like formatting, to help users visualize the structure. Obviously, this is causing some confusion, so we should probably include a disclaimer or other mechanism to reduce confusion. The aspects array sample is a flat out error that we will be sure to fix as quickly as possible. Again, we appreciate the feedback and apologize for any confusion we may have caused. I hope that you don't let a mistake in a sample prevent you from trying out the API, though. Thanks. Curtis, eBay Developers Program
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.