mnahkies / mnahkies/openapi-code-generator
typescript-koa: support serving docs using redoc
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 34
- Forks
- 8
- Avg merge
- 20h 27m
- Merged PRs (30d)
- 7
Description
add support for optionally serving documentation generated using https://github.com/Redocly/redoc for servers using typescript-koa template
essentially this will involve:
- exposing a route
/docsreturning an html document including the redoc html below - exposing a route
/openapi.yamlreturning the specification used to generate the server
the html will look similar to:
<html>
<body>
<redoc spec-url="http://petstore.swagger.io/v2/swagger.json"></redoc>
<script src="https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js"> </script>
</body>
</html>
with the spec path updated, and a sub resource integrity hash added (https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity)
this functionality should be optional, and the routes configurable to ensure that it can be used without collision with the actual API surface.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the typescript-koa template and the generated server's route and configuration entry points. Trace how the OpenAPI specification is included, then implement the optional configurable documentation routes. Done means the configured docs route serves Redoc HTML with the spec path and integrity hash, while the spec route returns the generated OpenAPI document without colliding with API routes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, typescript
- Domain
- backend-api-design, documentation
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100