MiSawa / xq

Pure rust implementation of jq
MIT License
318 stars 18 forks source link

[feature request] multi-format support #44

Open hh9527 opened 2 years ago

hh9527 commented 2 years ago

I found xq use serde as its deserializer, so it is possible to support other format beside json (yaml for example).

cat a.yaml | xq --fmt yaml
cat b.data | xq --fmt msgpack

and one more step, support schemaless data with additional schema

cat b.bin | xq --fmt bincode --schema my-bincode-schema.json --schema-fmt json
MiSawa commented 2 years ago

it is possible to support other format beside json (yaml for example).

Yeah that's actually why xq is prefixed by x instead of j. Though I neglected this for quite a while since it has a limitation (it has to have multi-document support) and I don't know each format enough.

and one more step, support schemaless data with additional schema

Passing schema for schemaless data is a great idea! It'll have the same limitation with above, but resolves the fundamental issue!