Data shape based minimalistic modeling and validation
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
No repository files or tests are named. Start by reading the proposed YAML examples and the linked malli schema documentation, then trace how yamlscript currently parses and validates YAML. Done would mean an agreed syntax and implementation that converts these shapes into usable malli schemas, with coverage for required, optional, repeated, bounded, and recursive fields.
Written by the indexing model from the issue text.
Description
It would be cool to be able to define and validate data using yaml shapes & yamlscript. Sure one can define data using JSON schema structures and use that to validate YAML, but something more minimalistic and data-driven like malli schemas in YAML would be more concise and easier to maintain.
Something like:
foo:
bar: boolean # Fields mandatory by default
baz ?: string # Optional
qux +: number? # 1..n
quux *: integer? # 0..n
quuux 0..4: pos-int? #
foo ?: foo # Ref to self
This type of syntax could be parsed to build for example malli schema registry and utilize existing built-in schemas as much as possible:
[:schema
{:registry {"foo" [:map
{:closed true}
[:bar :boolean]
[:baz {:optional true} :string]
[:qux [:+ number?]]
[:quux [:* integer?]]
[:quuux [:repeat {:min 0, :max 4} pos-int?]]
[:foo {:optional true} [:ref "foo"]]]}}
"foo"]
- Dominant language
- Clojure
- Stars
- 644
- Forks
- 62
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from yaml/yamlscript
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
yaml/yamlscript#273 ·
-
Blog post "YAML best practices": Whitespaces after colon `:` and before hashtag `#` are not rendered Open
Difficulty 1/5 1-3 hours Newbie friendliness 72/100
yaml/yamlscript#266 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
yaml/yamlscript#272 ·
-
Difficulty 5/5 Over a week Newbie friendliness 8/100
yaml/yamlscript#265 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
yaml/yamlscript#264 · 1 comment ·
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
.Team/Metabot Priority:P3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
needs triage
Difficulty 1/5 Under an hour Newbie friendliness 90/100