Replies: 1 comment 5 replies
-
The algorithm for this would be "anti unification". The idea has been around for a long time. See for instance: This is certainly something that would be very useful. There are some design issues that make this tricky in the general case, though:
In case 1, the "minimal" schema, where minimal is defined as the least upper bound is In other words, to design this properly, we really need to know how people intend to use this and what they typically expect. Input very welcome! If we take a simple stance towards the before-mentioned points, this doesn't have to be all that complicated. Anti unification is a fairly simple algorithm, generally speaking. |
Beta Was this translation helpful? Give feedback.
-
Would you be interested in functionality to generate a CUE schema from example JSON documents?
The idea would be that you throw a load of example JSON files that you want to generate at the tool and the tools spits out a minimal CUE schema which unifies with all the input documents. Such a generated schema could be useful for people getting started with CUE.
I've written such a tool to generate Go
struct
s from multiple JSON documents or multiple XML documents. Would you be interested in a contribution of similar functionality for CUE?Apologies if you already have a tool like this, or if I've mixed something up. I'm a CUE n00b.
Beta Was this translation helpful? Give feedback.
All reactions