Experimental support for generating Lakeview widgets - oneOf
and anyOf
#774
+400
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
const
supportnoConst
field slice filters to facilitate{{- range .NonRequiredFields | alphanumOnly | noConst}}
- most likely we don't need it, as we should better manipulate field maps in different passesconstOnly
to facilitatebody = { {{range .Fields | constOnly}}'{{.Name}}': {{template "const" .Entity}},{{end}} }
oneOf
support with constant discriminatorsanyOf
support withis_assignable
functionality delegated to a target language.Reference Python implementation of a supertype with constant discriminator resolution
Subtype name and version are decoupled from the actual type deserialization
Example Python implementation with constant discriminators
Type serialization silently encodes type/version metadata and ignores that on read
Loose supertype implementation in Python
pros:
list[Foo | Bar]
(which is essentiallylist[FooOrBar] && FooOrBar = Foo | Bar
), but cannot supportlist[Foo] | list[Bar]
cons:
names_like_this
tonamesLikeThis
on a per-module basis, if we want to supportanyOf
with loose typingTests