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

chore: type our path parameters #4471

Merged
merged 1 commit into from
Aug 21, 2024
Merged

chore: type our path parameters #4471

merged 1 commit into from
Aug 21, 2024

Conversation

gastonfournier
Copy link
Contributor

Path types in our openapi are inferred as string (which is a sensible default). But we can be more specific and provide the right type for each parameter. This is one example of how we can do that

@thomasheartman WDYT?

@vercel
Copy link

vercel bot commented Aug 10, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Aug 21, 2024 10:24am
unleash-monorepo-frontend ⬜️ Ignored (Inspect) Visit Preview Aug 21, 2024 10:24am

Copy link
Contributor

@thomasheartman thomasheartman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I hadn't thought of doing that (even if we do it for query parameters). I like the intention behind it, but I'm wondering how much work it'd be? As for the suggestion you've got here, I think we should also add a description at least. We could constrain the ID (it's probably at least 0, right?), but it has less value here, I suppose.

But yeah, I like it! Just wondering how much time and effort it would take 🤔

@gastonfournier
Copy link
Contributor Author

Ok, we've decided that this only makes sense when parameters are numbers, in all other cases it's fair to assume they're strings. So, we'll only add them when needed (like in this case) and assume that when not present they're strings.
I'll update this PR and merge it later

@gastonfournier gastonfournier marked this pull request as ready for review August 21, 2024 10:19
Copy link
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Manifest Files

@gastonfournier gastonfournier merged commit 45de8ce into main Aug 21, 2024
7 checks passed
@gastonfournier gastonfournier deleted the parameter-types branch August 21, 2024 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants