code-gov-web
code-gov-web copied to clipboard
`status` == empty string
In the 2.0 schema — Given that status is optional and accepts a string, would it be reasonable to expect an empty string to be an acceptable value?
Currently, https://code.gov/#/policy-guide/docs/compliance/inventory-code/tools/validate-schema doesn't validate correctly if I have the following in my code.json:
...
"status": "",
...
@IanLee1521 Does it validate if you do not include the "status" key at all? I believe that is our preference for treating optional keys.
We could work on adding empty strings or nulls if that fits your workflow better, though. Let me know!
@zachary-kuhn -- It does validate if I remove that key, but I think that is the only field that has this problem (see disclaimerText or disclaimerURL for two examples of several.
I have been working on https://github.com/llnl/scraper as a means to produce code.json files automatically, and in the current implementation (https://github.com/LLNL/scraper/blob/c1a8c36230e860a02e36843cbf2b63eb9d919f2e/scraper/code_gov/init.py#L219) I set all the fields in advance at object creation, before I know if the values will be provided by some process.
@IanLee1521 , I'll be working on this. I'll make sure to keep you updated.
Thanks @DanielJDufour ! Let me know if you need any additional information or testing from me.
@IanLee1521 , could you attach/share the JSON file that you're trying to get validated/ingested with the empty string for status? Thanks!
Sure thing. Here you go (adapted from https://energy.gov/code.json which was how I discovered this), it's a JSON formatted .txt file because apparently GitHub doesn't allow uploading .json files...
Thank you. Just a quick update. We're still discussing this as a team and we'll get back to you when a decision is made.
Thanks!