ZON Schema

I’ve been able to add ZON schema generation to zq:

For instance, here’s how to generate this Build.zon.zig schema from this build.zig.zon (or, see gen step):

# you can also specify other types, see `zq -h`
zq schema -e "name = enum { zq }" build.zig.zon 

For a more general example see generateSchema test.

I’m also planning to add support for:

  • Type checking enum literals.

  • Converting array’s with simple literal elements of the same type to slices, instead of structs.

1 Like