Open
Conversation
* Extracted schema finding logic from context to resolver * Flattened context to be a builder instead of wrapping one * Added a renderer that expands partials using contexts * Added Email, Datetime and Partial types and registered them * Added very simple spec for the renderer.
used when schemas are called directly, i.e. as root schemas. Thus the context is root.
used as root, i.e. get defaults for the base_object.
…re no basic_object defaults.
are not necessarily provided together, but separately.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
WIP since im working on the publication of schema_dsl still, so everything here should fail for now.
The basics of it:
Resolveremail: the email type that was a new method beforedate_time: The datetime type that was a new method beforepartialA Type that holds information on partials that should be expandedlocalsA type that holds locals information for partials. In the rendering process, these are combined with partials to expand them.PartialExpanderwhich recursively expands partials using partial and locals nodes and returns the completed ast for the other renderers to work normally on. Also removes partial and locals nodes afterwards.SchemaTemplates::Baseno longer delegates anything to its context because the context is executing the dsl definition and we would have an infinite loop otherwiseSchemaDsls type_defaults functionalityJSON::SchemaTemplatesfunctionality is activated on require, I added a test renderer that renders the templates while templates functionality is deactivated.Probably more, will have to look at the diff again 😅