1

I am looking for a way to extract part of a json doc using a json schema. So given a large and complicated json doc, sub parts of the data can be extracted using json schema.

This is different to validation.

The concept would be to take part of the response data from an api. make it easy to change what is extracted by simply changing the schema and not the code or extract different parts based on certain scenarios.

Nick Wood
  • 21
  • 1
  • Can you give an example of how that would work and what function json-schema would have in that idea? – Erwin Bolwidt Mar 31 '19 at 12:13
  • It sounds like you're looking to use JSON Schema for something that it isn't designed. It sounds like you want to extract bits of JSON. You might consider using jq: https://stedolan.github.io/jq/ It's a little tricky to get the hang of, but it's powerful, and probably what you actually want. – Relequestual Apr 01 '19 at 08:28

1 Answers1

0

If you're willing to try a different schema tech (ASN.1) take a look at this example https://dotnetfiddle.net/pk8vMa. It does what you want - partial schema to get partial data from JSON. (disclosure: I'm affiliated with developing DCodec library that is featured in this example).

AKha
  • 107
  • 1
  • 4