epoberezkin / json-schema-traverse

Traverse JSON Schema passing each schema object to callback
MIT License
100 stars 18 forks source link

Pass dataPath in callback #13

Open danturu opened 4 years ago

danturu commented 4 years ago

I'm wondering why where is no dataPath along with schemaPath (the second argument in the callback)?

epoberezkin commented 4 years ago

As a simple workaround, it can be tracked by collating "index/property" parameters that are passed to the callback.

danturu commented 4 years ago

OK, thank you. Will back to it soon.

Another question is: Why does callback pass arguments as an array not an object?

cb(node) where node is object { schema, schemaPath, etc...}

Are you OK to change the API it in the next major version?