-
Notifications
You must be signed in to change notification settings - Fork 6
Description
When writing JSONPath expressions, it's common to make mistakes where the expression is syntactically valid but matches nothing. Currently bump overlay just silently ignores such targets, which complicates troubleshooting.
It would be nice if the tool could warn the user about such noop targets. These warnings could be either always on, or enabled by some flag. For example speakeasy overlay apply has the --strict flag for this purpose.
Some common errors:
-
Typos in node names, values, filters:
$..parameters[?( @.name == 'fron_date' )] $..paramaters[?( @.name == 'from_date' )] $.servers[?( @.desciption == 'Dev' )] -
Skipping nodes in a path:
- target: $.components.schemas.SchemaName.propName # should be: ...SchemaName.properties.propName update: description: something example: 123
-
Extra nodes in a path:
$.paths.*[?( @.operationId == 'get_foo' )].get # '.get' is not needed here
-
Consider an overlay that targets an endpoint by its path or
operationId:$.paths['/foos/{id}'].get $.paths.*[?( @.operationId == 'get_foo' )]
Later this endpoint gets renamed (e.g.
/foos/{id}becomes/foos/{foo_id}) or itsoperationIdgets changed (e.g. maybe op IDs are autogenerated and the algorithm changes).
As an overlay author and maintainer, I would like to get notified about non-matches so that I can update the overlay to match the current state of my API.