grafana / thema

A CUE-based framework for portable, evolvable schema
Apache License 2.0
229 stars 12 forks source link

Allow unify references #154

Closed spinillos closed 1 year ago

spinillos commented 1 year ago

When we extend an interface with another interface, the reference is inside allOf tag of open-api schema.

Knowing that, we can move these values into a properties to render the interfaces instead their inner values. For any reason, if we don't have references, exists a default empty one that we needed to skip here.

Also, the current library implementation forces to set a type and json tag to every element and its the reason of the rest of the changes in this PR.

When we set group or expandref we aren't unable to find the reference of the interfaces and we have to put the inner interface values instead: here and here.

Update: We have a known issue with new flattern pattern where we are unable to find some references when we use _#schema definition. Using _join and schema individually fixes the issue.

spinillos commented 1 year ago

Each datasource is generating its own DataQuery struct... I understand that its something expected.

sdboyer commented 1 year ago

Each datasource is generating its own DataQuery struct... I understand that its something expected.

Yes, this is expected, at least for now. We'll soon need to deal with controls that allow us to generate these as references to imported types, similar to what we do in TS.