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

lacking type safety in the openapi route object #110

Open
moodysalem opened this issue Dec 20, 2023 · 2 comments
Open

lacking type safety in the openapi route object #110

moodysalem opened this issue Dec 20, 2023 · 2 comments

Comments

@moodysalem
Copy link

the static schema does not match the the request type, and does not have typing on the handle parameters

makes this library really hard to use

it's also not clear how to describe the parameters!

and there are multiple places where params can be defined!
image

need to make better use of typescript for this to be nice to use

i would also recommend the schema not being static so you don't have to compute the schema and construct everything until the route is hit

@patryk-smc
Copy link

This lib would be 100x better if those were typed. Happy to make PR if interested @G4brym

@G4brym
Copy link
Member

G4brym commented Feb 23, 2024

This is a known issue, i just didn't got any time yet to get to it
The issue with migrating from the static schema, is that we want to keep backwards compatibility with people using the static version

i would also recommend the schema not being static so you don't have to compute the schema and construct everything until the route is hit

I still need to think about this because, if we move the schema compute to only when the route is hit, we still need a way to compute all route schemas when someone hits openapi.json path

@patryk-smc feel free to open a PR 😄
if you decide to tackle both issues, please split into 2 pr's

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants