Skip to content
This repository has been archived by the owner on Aug 5, 2021. It is now read-only.

status == empty string #370

Open
IanLee1521 opened this issue Dec 13, 2017 · 8 comments
Open

status == empty string #370

IanLee1521 opened this issue Dec 13, 2017 · 8 comments
Assignees

Comments

@IanLee1521
Copy link
Contributor

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 IanLee1521 changed the title status = empty string status == empty string Dec 13, 2017
@zachary-kuhn
Copy link
Contributor

@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!

@IanLee1521
Copy link
Contributor Author

IanLee1521 commented Dec 15, 2017

@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.

@DanielJDufour DanielJDufour self-assigned this Jan 16, 2018
@DanielJDufour
Copy link
Contributor

@IanLee1521 , I'll be working on this. I'll make sure to keep you updated.

@IanLee1521
Copy link
Contributor Author

Thanks @DanielJDufour ! Let me know if you need any additional information or testing from me.

@DanielJDufour
Copy link
Contributor

@IanLee1521 , could you attach/share the JSON file that you're trying to get validated/ingested with the empty string for status? Thanks!

@IanLee1521
Copy link
Contributor Author

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...

empty_status.txt

@DanielJDufour
Copy link
Contributor

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.

@IanLee1521
Copy link
Contributor Author

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants