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

Move parameters schema keywords location #108

Merged
merged 5 commits into from Apr 5, 2024
Merged

Conversation

nxht
Copy link
Contributor

@nxht nxht commented Mar 22, 2024

@marclave marclave self-requested a review March 24, 2024 16:06
return {
// @ts-ignore
...rest,
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we need to keep this spread of rest at the root of the return and not in schema?

i'll be pulling and testing out tonight but wanted to give a review before that and ask ahead :)

Copy link
Contributor Author

@nxht nxht Mar 25, 2024

Choose a reason for hiding this comment

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

@marclave
Had a thought of it and I think it makes more sense to be under schema.

Most JSON schema keywords goes under schema except for description, required, examples. So there's lesser keywords to define

Also when we choose to define some keywords and send others to spread, it makes more sense to me to define generic keywords explicitly and send type-specific keywords like minLength, which belongs to schema, to the rest

@@ -27,17 +27,30 @@ it('returns a valid Swagger/OpenAPI json config for many routes', async () => {
)
.post(
'/json/:id',
({ body, params: { id }, query: { name } }) => ({
({ body, params: { id }, query: { name, email, birthday } }) => ({
Copy link
Collaborator

Choose a reason for hiding this comment

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

awesome! more tests :)

@marclave marclave merged commit 5e78190 into elysiajs:main Apr 5, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

Invalid parameters schema keywords location
2 participants