Open
Description
Just putting the demo code after adding the dependency in package.json, result.pointers is undefined.
Context
import { parseWithPointers, safeParse, safeStringify } from "@stoplight/json";
const result = parseWithPointers(`{
"hello": "world",
"address": {
"street": 123
}
}`);
console.log(result.data);
console.log(result.pointers);
(node:44456) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
{ hello: 'world', address: { street: 123 } }
undefined
Current Behavior
It gives undefined
Expected Behavior
It should have a source map with multiple paths
Possible Workaround/Solution
Steps to Reproduce
- Install package @stoplight/json
- Mix first example code with second example code
- Run
node ./sample.mjs
Environment
{ //... other settings
"dependencies": {
"@apidevtools/swagger-parser": "^10.1.0",
"@openapi-contrib/json-schema-to-openapi-schema": "^2.2.4",
"@openapitools/openapi-generator-cli": "^2.5.2",
"@stoplight/json": "^3.20.1",
"@stoplight/json-schema-merge-allof": "^0.7.8",
"@stoplight/json-schema-ref-parser": "^9.2.2",
"fs-extra": "^11.1.0",
"json-schema-merge-allof": "^0.8.1",
"json-schema-to-jsdoc": "^1.1.0",
"node-glob": "^1.2.0",
"openapi-types": "^12.1.0",
"uuid": "^9.0.0"
},
"devDependencies": {
"@types/node": "^18.11.18"
}
}
- Version used:
- Environment name and version (e.g. Chrome 39, node.js 5.4):
- NodeJs 19.4.0, VSCode 1.74.3
- Operating System and version (desktop or mobile):
- Windows 11 x64 Desktop
- Link to your environment/workspace/project:
Metadata
Assignees
Labels
No labels
Activity