Skip to content

Adding JSONPath-Plus  #57

@50rayn

Description

@50rayn

Is your feature request related to a problem? Please describe.

I'm using @quobix/vacuum for linting my openapi schema. It's a very nice tool for ensuring a high quality schema. So, I wanted to extend the basic linting rules by writing my own rules according to the docs. Afterwards I stuck on some issues with JSONPath. I have paths like:

  • $..[?(@.type == 'array')].default^.nullable - Property nullable is prohibited if default property defined
  • $.paths[?(!@property.match(/^\/login$/))][*] - All endpoints login
  • !@path.match(/allOf/) - Objects that are not under allOf

Describe the solution you'd like

Would be nice to extend the current list of options with those available from JSONPath Plus

  • shorthand selectors - @path, @parent, @property, @parentProperty, @root, @key
  • getting all parent components - $..
  • grabbing the parent of a matching item - ^
  • grabbing property names of matching items - ~

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions