Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Error when using VM #239

Copy link
Copy link
@flyerH

Description

@flyerH
Issue body actions

Describe the bug

JSONPath fails in VM mode (eval: 'safe') but works in native mode.

Code sample or steps to reproduce

$..parameters..[?(@property !== 'properties' && @.example !== void 0 && (@.type || @.format || @.$ref || @.properties || @.items))]
{
    "components": {
        "schemas": {
            "QueryCallbackResponse": {
                "properties": {
                    "num_out": {
                        "description": "description",
                        "example": 123123123,
                        "format": "int32",
                        "title": "title",
                        "type": "integer"
                    }
                },
                "type": "object"
            }
        }
    },
    "openapi": "3.0.0",
    "paths": {
        "/brand/sample/querycallback": {
            "get": {
                "description": "description",
                "operationId": "CallbackTesting",
                "parameters": [
                    {
                        "description": "description",
                        "in": "query",
                        "name": "num_in",
                        "required": false,
                        "schema": {
                            "description": "description",
                            "example": 123123123123,
                            "format": "int32",
                            "title": "title",
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/QueryCallbackResponse"
                                }
                            }
                        },
                        "description": "description"
                    }
                }
            }
        }
    }
}

Console error or logs

Figure 1: JSONPath failure under VM (eval: 'safe')
Image

Figure 2: Expected JSONPath result in native mode
Image

Expected behavior

Expected result

[
  {
    "description": "description",
    "example": 123123123123,
    "format": "int32",
    "title": "title",
    "type": "integer"
  }
]

Environment (IMPORTANT)

  • JSONPath-Plus version: 10.3.0

Desktop**

  • OS: Linux
  • Browser and version: Node.js 20

Additional context

This behavior started occurring after upgrading to v10. No issues before v10.
From the changelog, I think the VM changes broke this.
Image

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.