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

Frontmatter Schema Simplification #167

Merged
merged 3 commits into from
Oct 9, 2023
Merged

Conversation

AsherGlick
Copy link
Owner

Hopefully this is a simplification. JSONSchema is just really terrible in general for what we are trying to do. However it still has some uses when it comes to validation. This is just a wrapper around how the JSONSchema is generated so that we reduce mistakes.

When the old schema and the new schema were exported as json objects this was the diff between them:

--- old_schema.json	2023-09-29 23:08:11.147771543 -0500
+++ new_schema.json	2023-09-29 23:08:11.147771543 -0500
@@ -12,8 +12,8 @@
                 "MultiflagValue",
                 "Enum",
                 "CompoundValue",
-                "Custom",
-                "CompoundCustomClass"
+                "CompoundCustomClass",
+                "Custom"
             ]
         }
     },
@@ -611,9 +611,10 @@
                     "compatability",
                     "xml_fields",
                     "protobuf_field",
+                    "class",
                     "xml_bundled_components",
                     "xml_separate_components",
-                    "class"
+                    "components"
                 ],
                 "properties": {
                     "type": {

This diff shows that the only things that changed were the ordering of Custom and CompoundCustomClass in the global type variable limiter enum. This change is desirable because now the order that is in the enum limiter is the same order as the checks appear.

The other diff shows a similar movement of a field in the CompoundCustomClass schema definition of the value class which also now aligns with its ordering in the properties. Additionally the final diff shows that we had missed adding "components" as a required field to the CompoundCustomClass meaning that this change has already been able to catch a user error, caused from needless manual repetition.

@AsherGlick AsherGlick changed the base branch from xml_converter to parallel_pipelines September 30, 2023 07:39
Base automatically changed from parallel_pipelines to xml_converter October 4, 2023 22:16
@AsherGlick AsherGlick merged commit 3c7b758 into xml_converter Oct 9, 2023
12 checks passed
@AsherGlick AsherGlick deleted the frontmatter_schema_2 branch October 9, 2023 03:05
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

Successfully merging this pull request may close these issues.

2 participants