Utility change: reusable constants in yaml schema #17
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.
Related Issue
#7
Description
Implements global cross-file and local per-file constants for use in the yaml schema
It turned out that there was more design decisions I hadn't thought of, so I propose some differences with the original specifications. Please give any feedback you may have on those changes, as I can adapt them easily if need be.
Definition syntax
Instead of defining constants like "objects" in a list:
They are defined as key-value pairs:
This is less cumbersome and more "yaml like", and thus preferable in my opinion.
Reference syntax
Originally, references would use
@{...}@separators, but it turns out@is a reserved character in yaml and can't start a scalar. To try to avoid using characters reserved in both Yaml and SecLang for clarity, I used~{...}~as separator instead.Types
Constants can be either any yaml scalar, lists or even dictionaries. This allows defining constants that can define whole subsections of the schema
Properties
There are multiple properties that were not clearly described in the specs, I tried to discuss the most important ones in the README section.