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

schema maximum value for samples_start, sample_count, others is awkward #334

Open
gmabey opened this issue Jan 31, 2025 · 1 comment
Open

Comments

@gmabey
Copy link
Contributor

gmabey commented Jan 31, 2025

I'm working to use https://github.com/json-schema-org/json-schema-spec to validate SigMF metadata.
I'm finding that the schema-dictated maximum value for several properties to be very problematic, and I wonder if there's a good rationale for the current value:

18446744073709552000 = 2^64 + 384

I would like to suggest that the value 2**63-1 be used instead, as this makes it much easier for libraries like json-schema-spec to implement such a constraint.
This would cause a breakage for all those files out there with values > 9223372036854775807, it's true. But, given the number of elementary particles in the universe, I don't think that's going to be a problem in practice.
Like, it's one thing to enforce such a limit in python; it's something else to do so in generic C++. The implementation of json-schema-spec uses long to hold such a constraint, on a JSON element of type unsigned int (that's a nlohmann/json thing).

What is the origin of 18446744073709552000 anyway?

gmabey added a commit to gmabey/SigMF that referenced this issue Jan 31, 2025
reduces maximum constraint to 9223372036854775807 for several properties
@gmabey
Copy link
Contributor Author

gmabey commented Jan 31, 2025

In the interest of two witnesses, I used this on-line tool to generate some fictitious .sigmf-meta data: https://www.liquid-technologies.com/online-schema-to-json-converter
When I pasted the contents of sigmf-schema.json into the text box, I get an error: Specified cast is not valid..
BUT, when I pasted the contents of the #335 it was able to produce something.

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

1 participant