Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shared $ref between schemas #81

Open
lynnagara opened this issue Mar 31, 2023 · 1 comment
Open

Shared $ref between schemas #81

lynnagara opened this issue Mar 31, 2023 · 1 comment

Comments

@lynnagara
Copy link
Member

When defining the transactions schema, I noticed there was a lot of copy/paste from events. The reason for this is that the bulk of the schema definition related to the contexts object, which is fairly complex and also entirely the same in the two schemas.

It would be great if we can define these subschemas in one place and resolve them from multiple other schemas.

@untitaker
Copy link
Member

I think the way to achieve this is to implement a kind of schema preprocessor that combines multiple schemas into one. Now schemas have a compilation step.

A lot of tooling directly reads the JSON files, and that'll have to be changed. off the top of my head, json-schema-diff lint, type generator(s) and the actual published packages themselves use different methods each to load those files.

Probably at least a week's worth of work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants