Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Poor JSON response structure #32

Closed
@simpleshadow

Description

@simpleshadow

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, themeaning 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 theJSON:API spec.

Here's an example of the suggested improvement to the current structure:

{"word":"work","phonetic": ["wəːk"    ],"meanings": [{"partOfSpeech":"noun","definitions": [            {"definition":"activity involving mental or physical effort done in order to achieve a purpose or result.","example":"he was tired after a day's work in the fields","synonyms": ["labour","toil","exertion","effort","slog","drudgery","the sweat of one's brow"                ]            },            {"definition":"a task or tasks to be undertaken.","example":"they made sure the work was progressing smoothly","synonyms": ["tasks","jobs","duties","assignments","commissions","projects"                ]            }        ]    }, {"partOfSpeech":"verb","definitions": [            {"definition":"be engaged in physical or mental activity in order to achieve a result; do work.","example":"an engineer who was working on a design for a more efficient wing","synonyms": ["toil","labour","exert oneself","slave (away)","plod away"                ]            },            {"definition":"(of a machine or system) function, especially properly or effectively.","example":"his phone doesn't work unless he goes to a high point","synonyms": ["function","go","run","operate","perform"                ]            }        ]    }]}

Regrettably, I'm going to use theOxford Dictionaries API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp