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

issue with #235 #342

Open
0x0a0d opened this issue Jan 4, 2023 · 4 comments
Open

issue with #235 #342

0x0a0d opened this issue Jan 4, 2023 · 4 comments

Comments

@0x0a0d
Copy link
Contributor

0x0a0d commented Jan 4, 2023

with default validator option strict "remove" , update params will be remove everything except id

@0x0a0d
Copy link
Contributor Author

0x0a0d commented Jan 4, 2023

pull #235

@icebob
Copy link
Member

icebob commented Jan 12, 2023

What's your suggestion?

@0x0a0d
Copy link
Contributor Author

0x0a0d commented Jan 14, 2023

 		update: {
 			rest: "PUT /:id",
 			params: {
-				id: { type: "any" }
+				$$root: true,
+				type: 'object',
+				strict: false,
+				props: {
+					id: { type: "any" }
+				}
 			},
 			handler(ctx) {

Because I'm using default (fastest-validator), so I created this patch to fix problem, but I'm not sure with other validators.
In general, I think this pull should be reverted

@icebob
Copy link
Member

icebob commented Jan 16, 2023

This suggestion works for you only, it's not a common solution. By the way, I think for your case, $$strict: false can be enough.

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

2 participants