ahrefs / atd

Static types for JSON APIs
Other
308 stars 53 forks source link

atdcat: what is the <root type name> of the -jsonschema option for? #407

Open Karmaki opened 3 months ago

Karmaki commented 3 months ago

I am trying to use atdcat -jsonschema and I have been very happy to find this feature :+1:

But since my ATD files are used to handle different kinds of JSON files, I want to extract the JSON Schema from only a part of them. I thought that was the purpose of the <root type name> argument of the -jsonschema option, but whatever I put, it seems that I always get everything. Is this expected?

Karmaki commented 3 months ago

Sorry, I now understand that <root type name> is used for the top level object (I am not familiar with the JSON Schema...), but what confused me is that all the definitions are still exported.

So, I rephrase my question: would it be possible to export only the definitions that are needed to define the top level object?