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

JSON API for data access #28

Open
Phoscur opened this issue Jun 3, 2018 · 1 comment
Open

JSON API for data access #28

Phoscur opened this issue Jun 3, 2018 · 1 comment
Labels
enhancement Request for a feature
Milestone

Comments

@Phoscur
Copy link

Phoscur commented Jun 3, 2018

A PHP centered system always renders its template into HTML, but Web 2.0 SPAs render the DOM directly in the browser. Such web applications usually consume a REST JSON API .

  • short term:
    render variables that would be rendered into the html as a nested object/array JSON datastructure, so simple getJSON requests (requesting "application/json" datatype) can grab a state of the game too - this will achieve data access freedom (with session authorization, or better token bearer based authentication).

    • IMHO this would synergize well with the open(-source)ess of the project.
    • data serialization can be easily accomplished, e.g. U_Unit { .. public json_serialize: { json_encode($this) .. }
  • longterm:
    develop the interface design defining and refining it, covering all entities in further iterations

  • benefits:
    API spec is shared between client and server and is a perfect layer to write tests against. the spec wont depend on any implementation or language details - concentrating on the domain model entities and possible actions and their validation upon them.

@mamen mamen added this to the Version 0.3 milestone Jun 12, 2018
@mamen mamen added the enhancement Request for a feature label Jun 16, 2018
@Phoscur
Copy link
Author

Phoscur commented Aug 8, 2018

Automatic documentation and code generation: http://editor.swagger.io/

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

No branches or pull requests

2 participants