-
-
Notifications
You must be signed in to change notification settings - Fork 267
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
Poor JSON response structure #32
Comments
@simpleshadow I will look into this, this is my first API, so I did not knew about such things, I will look into it, and I will make changes, because this would be a breaking change, probably, I will ask you to pass version in query param, and based on version show either this structure or old one. |
Proposed JSON structure really is more logical, in Turkish, for example, I get 'ünlem' as key in json sometimes and it is not practical to have to iterate trough to be able to access values instead of accessing directly by a known and fixed key. |
Some of the "meaning" types that I found: determiner |
@simpleshadow @kovinet I have implemented version 1 of api to have this structure, currently I have not implemented for english language, for other languages you can access the version by sending v=1 in query params, can you use it and tell me if that is what you were looking to? |
I am also experiencing same problem. The meanings data in JSON response is hard to iterate over. Please make meanings return JSONObjects instead of JSONArrays then the problem would be solved. |
@hexdecimal16 I will implement that feature this weekend. |
@meetDeveloper Thanks... |
@meetDeveloper hey man did you looked it? |
Yeah will push fix today or by tomorrow at most. |
@hexdecimal16 I have done it, you can change |
Sorry for the delay, life got me. |
@simpleshadow Can you verify once this is how you wanted? |
@meetDeveloper Yah now it's fine. Thanks! |
Really dig what you've done @meetDeveloper! Was not aware that Google is using Oxford Dictionaries behind the scenes.
While I really dig the API, the current structure of the API responses makes it very unusable (at least in my JavaScript web-based client). Having values as keys is non-standard and iterating over them is a nightmare. For example, the
meaning
property should be an array and contain a standard object response withpartOfSpeech
(e.g.{ "partOfSpeech": "noun", ... }
).I'd suggest a response that takes cues from the JSON:API spec.
Here's an example of the suggested improvement to the current structure:
Regrettably, I'm going to use the Oxford Dictionaries API.
The text was updated successfully, but these errors were encountered: