-
-
Notifications
You must be signed in to change notification settings - Fork 128
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
Client-side validation #111
Comments
Why not just let the API tell you the error? Validating bodies would make the codebase much larger and harder to maintain; I really want to make sure it has a lot of benefits for users before going down this route. |
Thanks for your response. I am now writing a project that can convert books to notion type. and i got the error blow.
But i didn`t find the detail of validate rule in notion api page. Is this data structure too deeply nested? so i want to get the rule notion used. In addition to this, i think that local validation will benifit the unit test. The request made by UT is of no value to the notion server. All of the above are personal opinions, if you think it is unnecessary, i will close this issue. Finally, looking forward to your answer to question marked in bolded format. |
Here is the data i used.
|
I'm really not against the idea! I just think that:
Now, notion-sdk-js does seem to define the whole validation structures in their api-endpoints.ts file, so maybe we could use that with something like Js2Py, but that sounds quite experimental. |
All validation occurs after the post\patch request has been sent. But I need a stateless validation. So notion-sdk-js can achieve my goals. Js2Py is one way. Also I can edit the code and make a node.js micro-service to use notion`s rule to validate my data structure. Thank you for helping me find the way to solve the problem ~ |
You're welcome! If you end up using Js2Py, please keep me updated as I would love to see if that can be achieved that way. |
I am now using this sdk to do some develop. But usually i get the APIResponseError error.
APIResponseError: body failed validation.
I plan to write a simple validator in my code, and I'm curious if this feature will be added in the future.
The text was updated successfully, but these errors were encountered: