please tell me why on almost all the taps that I l...
# singer-tap-development
a
please tell me why on almost all the taps that I look at I see schemes in json format. But when I looked at Slack, there were diagrams in .py format like in the second screenshot? What should I use?
c
I think it's personal preference ... I prefer external JSON files, because they are easy to generate from sample data with tools like
genson
https://github.com/wolverdude/GenSON
a
I'll add that the Python you are seeing there are using our SDK helper classes. If you are writing them by hand, these classes make the code more concise and readable vs the native JSON Schema. But the final
.to_dict()
in your example screenshot does return the actual JSON Schema as a python dict.
But yes, to @christoph’s point, it is to a large degree up to personal preference: you can maintain JSON Schema files, or as python - there's no 'wrong answer'. 🙂 If migrating from an existing tap, you may already have .json text files, in which case you can use those. Or if you have json schema from the upstream source, you can import that from them.
a
It is not entirely clear to me at what point then this scheme (in the case of sjon) is converted to the desired format?
Where can I see the syntax for building schemas in json format? For example, how to describe an array of objects or something like that