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

Reject unknown fields from API requests #478

Open
noyoshi opened this issue May 20, 2024 · 0 comments
Open

Reject unknown fields from API requests #478

noyoshi opened this issue May 20, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@noyoshi
Copy link
Collaborator

noyoshi commented May 20, 2024

Feature request

We should reject requests that contain unknown fields

Motivation

This can help users debug why prompts aren't working right - its much easier if the server says "validation error" when you forget to set the API token in the "parameters" section of the request, for instance, and instead set it at the top level. Otherwise, you can get confusing errors such as "access denied" which makes no sense.

Your contribution

Can add https://serde.rs/container-attrs.html#deny_unknown_fields annotation to all of the requests

@tgaddair tgaddair added enhancement New feature or request good first issue Good for newcomers labels May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants