hammer
hammer copied to clipboard
Hammer tech JSON validity checker tool
Would be nice to have a hammer shell tool that checks that a technology's .json
is valid.
This is the .tech.json
equivalent of #160
See #220
Related #114
Is this really needed if we solve #114 and #220?
Yes, I think we still need this since #114 is to make writing MMMC easier and #220 is specific to MMMC. This is needed to help catch errors like gds map flie
.
@colinschmidt Are you working on this actively?
No I will be working on #114 and #220 because I think thats the primary cause for need for validation.
TechJSON
is now a Pydantic model, so validation is implicit.
I think having printed schema is still helpful - @vighneshiyer thoughts on having our PR CI generate/update a schema.json
file using .schema_json()
on the TechJSON
class?
Technically Pydantic doesn't perform precise validation on types upon deserialization (since it can coerce values found in the JSON to those annotated in the BaseModel). But it will validate that the schema / structure of the JSON matches that of the BaseModel.
And sure we can create a schema file from the TechJSON Model. I think we can have the readthedocs dotfile call a script that produces the schema.json
file and we can include it in the docs.