Unable to remove query parameters in visitor
See original GitHub issueDescribe the bug Unable to remove query parameters in visitor.
To Reproduce Attempted to remove query parameters using a visitor.
'remove-hidden-parameters': () => {
return {
Parameter: {
leave(parameter, ctx) {
if (parameter['x-hidden']) {
delete ctx.parent[ctx.key];
}
}
}
}
Expected behavior
Expected query parameters with x-hidden: true
to be removed.
Actual behavior
YAMLException: unacceptable kind of an object to dump [object Undefined]
at writeNode (/usr/local/lib/node_modules/@redocly/openapi-cli/node_modules/js-yaml/lib/js-yaml/dumper.js:779:13)
at writeBlockSequence (/usr/local/lib/node_modules/@redocly/openapi-cli/node_modules/js-yaml/lib/js-yaml/dumper.js:542:9)
at writeNode (/usr/local/lib/node_modules/@redocly/openapi-cli/node_modules/js-yaml/lib/js-yaml/dumper.js:763:9)
at writeBlockMapping (/usr/local/lib/node_modules/@redocly/openapi-cli/node_modules/js-yaml/lib/js-yaml/dumper.js:657:10)
at writeNode (/usr/local/lib/node_modules/@redocly/openapi-cli/node_modules/js-yaml/lib/js-yaml/dumper.js:750:9)
at writeBlockMapping (/usr/local/lib/node_modules/@redocly/openapi-cli/node_modules/js-yaml/lib/js-yaml/dumper.js:657:10)
at writeNode (/usr/local/lib/node_modules/@redocly/openapi-cli/node_modules/js-yaml/lib/js-yaml/dumper.js:750:9)
at writeBlockMapping (/usr/local/lib/node_modules/@redocly/openapi-cli/node_modules/js-yaml/lib/js-yaml/dumper.js:657:10)
at writeNode (/usr/local/lib/node_modules/@redocly/openapi-cli/node_modules/js-yaml/lib/js-yaml/dumper.js:750:9)
at writeBlockMapping (/usr/local/lib/node_modules/@redocly/openapi-cli/node_modules/js-yaml/lib/js-yaml/dumper.js:657:10) {
reason: 'unacceptable kind of an object to dump [object Undefined]',
mark: undefined
}
openapi-cli
Version(s)
What version of openapi-cli
are you using?
1.0.0-beta.18
Node.js
Version(s)
v14.14.0
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
how to remove a query parameter from a query string
In Android, without import any library. I write a util method inspired by this answer Replace query parameters in Uri.Builder in Android?
Read more >How To Exclude URL Query Parameters in Google Analytics
One way to remove query parameters from pages is through the View Settings. Under Admin > View Settings > Exclude Query Parameters, ...
Read more >How to Exclude Query String Parameters from Google ... - Elevar
Option 1: Create Filter to Exclude All Query Parameters · Option 2: Use Exclude Query Parameters Config Setting · More Google Analytics Tips...
Read more >Cannot Delete Query/Parameter/Table
Hi, I have this query entry that I cannot delete. This query was originally belonged to a number of queries created when entering...
Read more >Cannot remove query parameters when rerouting ... - GitHub
Minimal reproducible example. A view which gets a query parameter and throws an exception: @Route class MainView extends Div implements ...
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 Free
Top 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
Thanks for the reply and suggestion @slavikbez . I have been busy but will give it a try and report back.
@slavikbez this is because they are an array?
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice