Skip to content

querying throws an error if the key in the object starts with a number. #190

Description

@clifrocks311

this is the error I am receiving:

"errors": [
{
"message": "Parse error on line 1:\n...ls[0].rateOfReturn.9mCNoload\n-----------------------^\nExpecting 'DOT', 'DOT_DOT', '[', got 'IDENTIFIER'",
"name": "Error",
"stack": "Error: Parse error on line 1:\n...ls[0].rateOfReturn.9mCNoload\n-----------------------^\nExpecting 'DOT', 'DOT_DOT', '[', got 'IDENTIFIER'\n at Parser.parseError (/Users/cxho3/Sandbox/service-virtualization-framework/node_modules/jsonpath/generated/parser.js:166:15)\n at Parser.parser.yy.parseError (/Users/cxho3/Sandbox/service-virtualization-framework/node_modules/jsonpath/lib/parser.js:13:17)\n at Parser.parse (/Users/cxho3/Sandbox/service-virtualization-framework/node_modules/jsonpath/generated/parser.js:224:22)\n at JSONPath._normalize (/Users/cxho3/Sandbox/service-virtualization-framework/node_modules/jsonpath/lib/index.js:198:24)\n at JSONPath.stringify (/Users/cxho3/Sandbox/service-virtualization-framework/node_modules/jsonpath/lib/index.js:168:15)\n at JSONPath.value (/Users/cxho3/Sandbox/service-virtualization-framework/node_modules/jsonpath/lib/index.js:63:31)\n at modifyResponsePayload (/Users/cxho3/Sandbox/service-virtualization-framework/lib/util/modifyGetResultset.js:898:30)\n at Object.selectFromDB (/Users/cxho3/Sandbox/service-virtualization-framework/lib/util/modifyGetResultset.js:1069:27)\n at processTicksAndRejections (internal/process/task_queues.js:95:5)\n at async virtualizeAPI (eval at (/Users/cxho3/Sandbox/service-virtualization-framework/node_modules/mountebank/src/models/responseResolver.js:63:34), :165:58)"
}
]
}

here is the object I am passing in:
{
return {
statusCode: 200,
headers: { "Content-Type": "application/json" },
body: {
"entityId": "a6c93fd4-bf67-b8666eea3232",
"entityName": "CanaFund",
"sourceEntityId": 21168,
"sourceEntityName": "CanaFund",
"source": "Eagle",
"asOfDate": "2021-07-15",
"returnDetails": [
{
"shareClass": "Class C",
"rateOfReturn": {
"name": "clifton",
"address": "string",
"5dCLoad": "five string",
"5dCNoload": "string",
"7dCLoad": "string",
"7dCNoload": "string",
"1mCLoad": "string",
"1mCNoload": "string",
"3mCLoad": "string",
"3mCNoload": "string",
"6mCLoad": "string",
"6mCNoload": "string",
"9mCLoad": "string",
"9mCNoload": "string",
"1yCLoad": "string",
"1yCNoload": "string",

looks like if the key starts with a number, it is now able to parse correctly?
Any suggestions?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions