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?
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 & http://jsonlint.com & http://codebeautify.org/jsonvalidator - all fail.
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.
3 Replies· Add your reply
Answer by curtis_developerprogram · Nov 09, 2016 at 10:20 PM
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.
Curtis, eBay Developers Program
[Bug report] False Delivered Status 0 Answers
OData support 0 Answers
Bug report 0 Answers