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

Improve samples in Web API #1552

Open
xsebek opened this issue Sep 28, 2023 · 1 comment
Open

Improve samples in Web API #1552

xsebek opened this issue Sep 28, 2023 · 1 comment
Labels
C-Low Hanging Fruit Ideal issue for new contributors. T-Web Involves the web interface - generally communicating with Swarm via ports. Z-Developer Experience This issue seeks to make life easier for developers writing Scenarios or other Swarm code. Z-Documentation This issue is about README or Wikis or Haddock or...

Comments

@xsebek
Copy link
Member

xsebek commented Sep 28, 2023

The Web API documentation can automatically generate example queries and results using the ToSample instance.

Add this instance to all used types, namely:

  • Objective which is transitively required by
    • GoalTracking
    • WinCondition

It would be good to read the Servant docs and make it look good and readable.

Leftover from:

@xsebek xsebek added C-Low Hanging Fruit Ideal issue for new contributors. Z-Documentation This issue is about README or Wikis or Haddock or... T-Web Involves the web interface - generally communicating with Swarm via ports. Z-Developer Experience This issue seeks to make life easier for developers writing Scenarios or other Swarm code. labels Sep 28, 2023
@xsebek
Copy link
Member Author

xsebek commented Sep 28, 2023

An example from swarm generate endpoints:


GET /repl/history/full

Response:

  • Status code 200

  • Headers: []

  • Supported content types are:

    • application/json;charset=utf-8
    • application/json
  • Example (application/json;charset=utf-8):

[]
  • Example (application/json;charset=utf-8):
[{"in":"grab"}]

The ideal would be to have this for all endpoints, so that its easy to test first on dummy data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Low Hanging Fruit Ideal issue for new contributors. T-Web Involves the web interface - generally communicating with Swarm via ports. Z-Developer Experience This issue seeks to make life easier for developers writing Scenarios or other Swarm code. Z-Documentation This issue is about README or Wikis or Haddock or...
Projects
None yet
Development

No branches or pull requests

1 participant