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

[FEATURE] (type-safe-api) WebSocket API Documentation Generation #742

Closed
1 of 2 tasks
cogwirrel opened this issue Mar 28, 2024 · 1 comment · Fixed by #754
Closed
1 of 2 tasks

[FEATURE] (type-safe-api) WebSocket API Documentation Generation #742

cogwirrel opened this issue Mar 28, 2024 · 1 comment · Fixed by #754
Labels
feature-request New feature or request needs-triage

Comments

@cogwirrel
Copy link
Member

Describe the feature

Support for generating documentation for WebSocket APIs.

Use Case

For parity with Type Safe API.

Proposed Solution

While we do have an OpenAPI spec, using the existing documentation generation will produce API docs which look too much like a REST API, for example will include HTTP methods and paths.

Either by modifying or wrapping existing generators, add support for generating documentation which shows each operation and it's input types. It would also be useful to include that the data sent on the websocket needs to be of the format { "route": "<Operation>", "payload": ... }.

Given that redoc produces the best documentation, it's worth investigating whether that can be customised at all.

It may be wise to add a new enum, WebSocketDocumentationFormat instead of reusing DocumentationFormat as we do currently, so as not to tie them together. This wouldn't be considered a breaking change as we throw an error at projen synth time if the user has provided any documentation formats.

Other Information

Remove the following once implemented:

// TODO: Delete when documentation support is implemented
if (documentationFormats.length > 0) {
throw new Error(
"Documentation generation is not yet supported for WebSocket APIs"
);
}

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

PDK version used

0.23.26

What languages will this feature affect?

No response

Environment details (OS name and version, etc.)

OSX

@cogwirrel cogwirrel added feature-request New feature or request needs-triage labels Mar 28, 2024
@cogwirrel
Copy link
Member Author

May be worth considering converting the OpenAPI-like spec to AsyncAPI and then using the Async API CLI to generate documentation from that.

cogwirrel added a commit that referenced this issue Apr 9, 2024
Convert the OpenAPI spec to AsyncAPI, and use AsyncAPI's documentation generators for html and
markdown documentation

Fixes #742
cogwirrel added a commit that referenced this issue Apr 10, 2024
Convert the OpenAPI spec to AsyncAPI, and use AsyncAPI's documentation generators for html and
markdown documentation

Fixes #742
agdimech pushed a commit that referenced this issue Apr 11, 2024
…pis (#754)

Convert the OpenAPI spec to AsyncAPI, and use AsyncAPI's documentation generators for html and
markdown documentation

Fixes #742
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request needs-triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant