chips icon indicating copy to clipboard operation
chips copied to clipboard

Inconsistency between CHIP-0007 specification and JSON Schema

Open canardleteer opened this issue 3 years ago • 5 comments

I noticed that the CHIP-0007 spec document, specifies the that a Collection's ID is a string.. The JSON Schema provided, specifies this as a string with a format of UUID. There is no mention of "UUID" at all, in the specification itself.

I'm fine with (and welcome) the JSON Schema providing this additional constraint, however, I'd suggest it be added to the human readable specification as well... or be removed from from the JSON Schema version.

canardleteer avatar Nov 21 '22 03:11 canardleteer

Good catch! I'll add a note to the spec that the format needs to be uuid.

danieljperry avatar Nov 21 '22 03:11 danieljperry

@danieljperry - Found another one. I promise I'm not being pedantic, but I am letting Rust and Quickcheck be pedantic for me, and I'm just reporting what it's yelling at me about. :)

series_number & series_total are defined in the spec as "integers." 0 is an integer (I'll let mathematicians debate this separately), as is -1000. I don't imagine it makes sense to use a negative number at all for either (I assumed u64 myself), but I could see someone choosing a Series Number of 0, or being quirky and counting up towards 0 in series_number from -1000... As written, the spec allows for any integer. The JSON Schema, quite reasonably specifies that these two numbers must be a positive integer greater than 0.

I'd suggest the spec annotate that these numbers must be a "positive integer greater than 1," or the constraint relaxed in the JSON Schema.

canardleteer avatar Nov 26 '22 01:11 canardleteer

No problem, thanks for pointing this out. The following two PRs will add errata for the respective updates you have requested:

https://github.com/Chia-Network/chips/pull/41 https://github.com/Chia-Network/chips/pull/42

danieljperry avatar Nov 28 '22 02:11 danieljperry

Our Collection ID is not a UUID, so it may be late on that item.

RightSexyOrc avatar Nov 28 '22 17:11 RightSexyOrc

Thanks @danieljperry! I didn't quite have the time to read up on the CHIP process for Errata, so didn't submit any MR's directly, and am hesitant to just close this without #42 landing upstream... But I will try to read through the process doc when I get the chance.

I guess feel free to close at your leisure?

canardleteer avatar Dec 03 '22 02:12 canardleteer