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

Web API docs improvements #1529

Merged
merged 10 commits into from
Sep 28, 2023
Merged

Web API docs improvements #1529

merged 10 commits into from
Sep 28, 2023

Conversation

xsebek
Copy link
Member

@xsebek xsebek commented Sep 16, 2023

  • generate Web API endpoint docs in CLI - swarm generate endpoints
  • use default port in API docs using renderCurlBasePath
  • fix code rendering in Web API so that the tree nodes try to fit one line
  • try adding some API samples
  • hand craft ToJSON Robot instance to match FromJSONE more closely
    • default values are skipped
    • inventory and devices are shortened to names and counts

@@ -51,14 +58,15 @@ import Network.Wai.Handler.Warp qualified as Warp
import Servant
import Servant.Docs (ToCapture)
import Servant.Docs qualified as SD
import Servant.Docs.Internal qualified as SD (renderCurlBasePath)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be a problem as the record field is reexported normally. I made a PR to eventually fix that:

Copy link
Member

@byorgey byorgey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, modulo the failing CI (looks like a couple forgotten todos?).

@xsebek xsebek mentioned this pull request Sep 28, 2023
@xsebek xsebek force-pushed the xsebek/generate-endpoints-docs branch from 5ce2fb7 to e168e3b Compare September 28, 2023 08:46
@xsebek xsebek added the merge me Trigger the merge process of the Pull request. label Sep 28, 2023
@mergify mergify bot merged commit 24ef7c2 into main Sep 28, 2023
10 checks passed
@mergify mergify bot deleted the xsebek/generate-endpoints-docs branch September 28, 2023 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge me Trigger the merge process of the Pull request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants