mnahkies / mnahkies/openapi-code-generator

typescript-koa: support serving docs using redoc

Open
#81 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue typescript-koa
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 /docs returning an html document including the redoc html below
  • exposing a route /openapi.yaml returning 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.