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 (e.g. for Objective) in Web API #1552

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

Improve samples (e.g. for Objective) in Web API #1552

xsebek opened this issue Sep 28, 2023 · 1 comment
Labels
C-Low Hanging Fruit Ideal issue for new contributors. S-Nice to have The bug fix or feature would be nice but doesn't currently have much negative impact. 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.

@byorgey byorgey added the S-Nice to have The bug fix or feature would be nice but doesn't currently have much negative impact. label Aug 20, 2024
@byorgey byorgey changed the title Improve samples in Web API Improve samples (*e.g.* for Objective) in Web API Aug 20, 2024
@byorgey byorgey changed the title Improve samples (*e.g.* for Objective) in Web API Improve samples (e.g. for Objective) in Web API Aug 20, 2024
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. S-Nice to have The bug fix or feature would be nice but doesn't currently have much negative impact. 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

2 participants