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

Allow updating and removing primitive values #57

Open
ralfhandl opened this issue Sep 11, 2024 · 1 comment
Open

Allow updating and removing primitive values #57

ralfhandl opened this issue Sep 11, 2024 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@ralfhandl
Copy link
Contributor

ralfhandl commented Sep 11, 2024

The current text does not allow directly targeting a primitive value, for example a certain string in the tags array of an Operation Object, and thus does not allow a convenient/workable way to remove or replace a certain tag name without knowing all other tag names in the tags field.

Proposal

Allow target JSON Path expressions to select nodes of all JSON types.

For example allow

overlay: 1.0.0
info:
  title: Remove a string from the tags array of all operations
  version: 1.0.0
actions:
  - target: $.paths.*.*.tags[?@ == 'dummy']
    remove: true

and

overlay: 1.0.0
info:
  title: Preplace a string in the tags array of all operations
  version: 1.0.0
actions:
  - target: $.paths.*.*.tags[?@ == 'Foo']
    update: "Bar"
@jeremyfiel
Copy link

If this is allowed, #70 should be discarded in 2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants