kristoff-it / ziggy

A data serialization language for expressing clear API messages, config files, etc.
https://ziggy-lang.io
MIT License
292 stars 17 forks source link

schema: complete validation #9

Open kristoff-it opened 8 months ago

kristoff-it commented 8 months ago

In the construction of a Schema struct, we currently check for:

What's missing:

Note that the presence of any automatically colors everything.

How to get started

Here we perform the aforementioned analysis: https://github.com/kristoff-it/ziggy/blob/4905290ae14391963ec2b11a72e81f779577824f/src/schema/Schema.zig#L168-L176

Below those lines it would make sense to call a new function that performs the remaining checks. It might make sense to add a field or two to the existing types (eg StructRule, Rule).