ROR schema backward compatibility

30 views
Skip to first unread message

Adam Clark

unread,
Feb 6, 2025, 5:14:07 AMFeb 6
to ROR Technical Forum
I ran into a couple issues trying to handle data produced using schema v2.1, which now includes most (all?) the results coming from the API.

A relatively trivial issue is that at https://github.com/ror-community/ror-schema the "master" branch currently does not include the v2.1 schema -- I had to go to the "schema-v2-1" branch in order to get the updated version. Since v2.1 is now public I think that schema should not be hidden in a feature branch.

The stickier issue actually came up earlier, when I tried to parse a newer ROR entry using the v2.0 schema. This failed because of the enumerated values here:
This enum only includes "1.0" and "2.0" -- so trying to parse data marked with schema v2.1 fails because "2.1" is not enumerated.

Once I updated my parser to use schema v2.1 everything worked, but I'm considering reverting to v1.0 because as things stand now I would expect my code to start failing without warning should a v2.2 be released.

For full disclosure I'm using https://koxudaxi.github.io/datamodel-code-generator/ to generate a Pydantic-based parser based on the schema. I gather from searching around that some parser generators support reading unknown enum values, but the one I'm using appears not to.

Cheers,
Adam


Liz Krznarich

unread,
Feb 6, 2025, 6:03:44 AMFeb 6
to ROR Technical Forum, [email protected]
Hi Adam,

Sorry about this - when we release new schema versions, we very often leave the schema and our validation and release deployment code on branches for a short time until we have done a full data release and have ensured that any issues with the deployment have been caught and fixed. Due to the holidays and some travel by the ROR team, we left these branches open a little longer than usual. I will merge these up within the next 2 days.

As for future releases, we'll close up the schema branches more quickly.  The schema/API minor version releases themselves so always come with advance notice - in this case, a v2.1 proposal was circulated in Oct 2024 https://groups.google.com/u/1/a/ror.org/g/ror-tech/c/6R80111EBb8 and final plans were announced in Nov https://groups.google.com/u/1/a/ror.org/g/ror-tech/c/9QrSwPeVqsE , ahead of the deployment announced here in mid-Dec https://groups.google.com/u/1/a/ror.org/g/ror-tech/c/rjC5kyyfb9Y

Cheers,
Liz

Adam Clark

unread,
Feb 10, 2025, 10:54:51 PMFeb 10
to Liz Krznarich, ROR Technical Forum
Hi Liz,

Thanks for the quick reply!

I'm afraid this does not do much to alleviate my concerns about versioning. It just doesn't seem workable for us to preemptively update our ROR clients based on somebody watching these forums.

I don't have a lot of expertise around json schemas, but I found a few references to this pitfall around enums:

I tried swapping "x-extensible-enum" for "enum" (as suggested in the first link) in the schema and this worked as expected -- my generated code treats these as strings rather than enums so the data validates. I do appreciate that this is nonstandard, though. Alternatively, would it be possible to make the version a simple string (perhaps with a regex), or include only the major version number? The fact that this will break clients even on point version changes is the part that concerns me the most.

(Also, feel free to tell me that the intended use of the schema is primarily intended for internal validation rather than for use by external clients.)

Cheers,
Adam

--

Adam Clark
Reply all
Reply to author
Forward
0 new messages