mnahkies / mnahkies/openapi-code-generator
Generating implementation based on tags
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 34
- Forks
- 8
- Avg merge
- 20h 27m
- Merged PRs (30d)
- 7
Description
Having the ability to separate routes based on tags specified in the openapi schema. This would make it easier to implement routes in classes for that specific tag.
I would assume it might end up looking something like this
export type MiscEndpoints = {
getVersion: GetVersion,
getSpec: GetSpec,
}
export type Implementation {
miscRoutes: MiscEndpoints ,
// non tagged endpoint
getInfo: GetInfo,
}
I assume this might end up requiring a little more work as to figure out that MiscRoutes implements sub routes, so I'm not sure of what the best way to do that is for this project, but hopefully this is enough information to give you an idea of what I am trying to get at.
Generally in most cases you end up having a file full of functions that implements something like /users endpoint, and you would return a router implementing those routes, but would be nice to be able to implement these routes from a class such as in my case.
Right now it's not very easy to implement from a class, cause I generally have to make another structure and target specific routes for those specific routes such as /users, and /version and /spec are misc routes.
Would like to discuss more on this topic, if you have any ideas?
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
No files, tests, or entry points are named. Start by tracing how server routes and implementations are currently generated, then compare that structure with the proposed tag-based grouping and class implementation model. This issue needs an agreed design and acceptance criteria before completion can be judged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100