Bad JSON schema? A typify codegen bug? serde-json issue?

Exercising code generated by typify from W3C's mnx-schema.json doesn't behave as expected-- as the generated docs imply that it should.

While I've modified JSON schema before, I'm still learning when it comes to the level of complexity in the MNX schema and would like some help.

My branch demonstrates a parse failure of MNX "tuplets". Newer integration tests within the branch's tests/canary.rs pass with existing/known behavior.

The repo exercises typify's PR 912 using the W3C schema, and tests are using their examples.

More details and instructions (e.g., git submodule for W3C's repo) are in the branch's README.

Possible scenarios:

  1. bad JSON schema?
  2. serde-json issue?
  3. cargo typify codegen bug?
  4. other?

W3C's MNX is a work-in-progress but at a stage where they're mainly adding functionality, and their tooling is reported to be sufficiently robust.

Any help in pruning the problem space would be greatly appreciated! Which of those enumerated points above can be ruled-out? Maybe something is obvious to you that eludes me?

In the meantime, any suggestions for a good tutorial on non-trivial JSON schema? I would like to create a minimal excerpt of this schema and am embarking on that learning curve now.

Thanks!

Ultimately, this issue hits an unimplemented feature within typify itself due to omitting "unevaluatedProperties" per draft 2019-09, yet mnx-schema.json requires it and also specifies draft 2020-12.

I reached this conclusion after using other validation crates such as boon to confirm the schema and examples. Reading the latest JSON schema spec with an eye towards priority, order of evaluation, etc. confirmed semantic differences between event and tuplets, Finally, a simple search for "unevaluatedProperties" within typify's issues and PRs confirmed root cause. I had yet to try other languages for their tooling, but that would have been next.

For those who are also relatively new to non-trivial JSON schema, like I was:

One possible alternative would have been mnx-schema.json specifying "required" for "event" and including "type" within there, and that would have disambiguated event from tuplet. However, the MNX schema uses event as an object with minimal attributes that also behaves as a catch-all. Hence, why the Working Group members opted for "unevaluatedProperties". That's based upon my understanding and could be missing a bit of nuance.