Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Json Schema Definition #275

Open
Nepomuceno opened this issue Apr 5, 2023 · 5 comments
Open

No Json Schema Definition #275

Nepomuceno opened this issue Apr 5, 2023 · 5 comments

Comments

@Nepomuceno
Copy link
Contributor

Nepomuceno commented Apr 5, 2023

There is no Json Schema https://json-schema.org/ that we could use to validate a metadata file. in this repo we can find the file in the python repo. https://github.com/sigmf/sigmf-python/blob/main/sigmf/schema-meta.json

But even in the python repo it does have problems of not actually validating the input of the data.

The solution would be to create a json schema file that would encompass preferable all the core values but also the extensions if possible.

@jacobagilbert
Copy link
Member

Validation is indeed an area we need help with.

Are there other problems with the schema besides not having extension fields in it?

@Nepomuceno
Copy link
Contributor Author

Yes there are problem on data validation for the string and numerical fields for example the datatype does allow any string to be input and the same are true for the uint fields that do not limit the min anx max for all the scenartios.

I should have a PR adding those fix by the end of the day today... My idea was to put this PR in a spec folder in this repo but I am open to suggestions.

@777arc
Copy link
Member

777arc commented Apr 6, 2023

I think the lack of a maintained json schema has been a hole, and it should live within this repo, we'll just have to determine the cleanest way for the python package to get a copy of it (e.g. submodule this repo?).

Question- for the schema associated with each extension, is there a clean way to have them in separate files? I don't think it would be sustainable to have one large schema that includes the extensions.

@jacobagilbert
Copy link
Member

To add to Marc's point on individual extension schemas, adding them to a monolithic schema is unappealing since it makes it harder for people to validate just what they care about, and more importantly to add their own schema files for their own extensions.

@Nepomuceno
Copy link
Contributor Author

You can use $ref in order to extend JSON schemas that way if you were using extensions you could include the $ref and use all of those schemas and for someone developing their own schema they can use $ref with their own subschemas to include the properties they want

https://json-schema.org/understanding-json-schema/structuring.html

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

No branches or pull requests

3 participants