typeshare icon indicating copy to clipboard operation
typeshare copied to clipboard

Support JSON Schema as Output

Open wyatt-herkamp opened this issue 2 years ago • 4 comments

It would be cool if we could support Json Schema as a language output.

I would be open to implementing this. However, I would like to know if this feature would be allowed in this project.

wyatt-herkamp avatar Jan 01 '23 15:01 wyatt-herkamp

I like this idea. However, since the JSON schema may vary based on language-specific annotations, I think it would be better to classify this generation method as an intermediate representation of sorts. That is, it would be generated alongside one or more specific languages, instead of being a language in and of itself.

snowsignal avatar Jan 09 '23 18:01 snowsignal

This would be really cool as an intermediate representation. It would immediately extend the capabilities of typeshare to all languages that JSON Schema has generators.

kjvalencik avatar Jan 09 '23 18:01 kjvalencik

For the time being this isn't a high priority at 1Password but we would welcome community contribution.

erik1p avatar May 01 '23 17:05 erik1p

Currently typeshare puts all definitions in one file.

Json Schema requires one type definition per file. 

My suggestion for a fix would be to add a require_file_per_type function to the Language type. and if it is true. It will treat ARG_OUTPUT_FILE as a direction. And then create a file per type.

wyatt-herkamp avatar May 05 '23 15:05 wyatt-herkamp