Option to strip out unused parameters
See original GitHub issueThis may already be included somewhere, but it would be awesome if there was an option to strip out parameters that aren’t in the docs. For example:
If a query parameter age
is defined, but ?age=30&foo=bar
is passed, I would like req.query
to only contain age
.
I’m not sure which underlying express-openapi-*
module would contain this, or perhaps it would be a new one.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:10 (6 by maintainers)
Top Results From Across the Web
What is the best way to suppress A "Unused variable x" ...
In GCC and Clang, add -Wno-unused-parameter option at the end of the command line (after all options that switch unused parameter warning on ......
Read more >IDE0060: Remove unused parameter - .NET
The option value specifies if unused parameters should be flagged only for non-public methods or for both public and non-public methods. For ...
Read more >C# - IDE0060: Remove unused parameter
Option 2 – Remove the parameter · Right-click the method name. · Click Quick Actions and Refactorings… · Click Change signature… · Select...
Read more >Unused parameters in C and C++
This macro does two things: first, it abstracts the definition of the attribute so that configure may strip it out if the attribute...
Read more >Autoflake — Remove Unused Imports & Unused Variables ...
To remove unused variables, use the --remove-unused-variables option. Below is the full listing of options: usage: autoflake [-h] [-i] [-r] ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The ajv option “removeAdditional: true” does this when the schema has “additionalProperties: false”. There are other options for removeAdditional
I’m dealing with same/similar problem, need to remove additional data without throwing errors.
"additionalProperties: false"
into schema validator throw errorsAjv
configremoveAdditional: true
it removes additional data and not throws errorsVery helpful is this test https://github.com/ajv-validator/ajv/blob/ba752505cf53a136eda1c4f4b81bf9e697a42dc2/spec/options/removeAdditional.spec.ts#L27
Would be nice to have ajv options configurable for
openapi-request-validator
, or at least just this oneremoveAdditional
. (using only componentopenapi-request-validator
)UPDATE: i want to remove additional data from body.