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

Outdated schema validator produces validation error despite file being valid #126

Open
sdruskat opened this issue Feb 20, 2024 · 5 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@sdruskat
Copy link
Member

Reported by @hainesr via email:

The possible problem I’ve come across is that I can’t get a 1.3.0 CFF to validate due to the following error: “Validation error: #/authors/0: failed schema #/properties/authors/items: More than one subschema in "oneOf" matched.” I see that in 1.2.0 we had “anyOf” instead of “oneOf” for the authors field (again, is this a backwards incompatibility issue??) and the same CFF will validate fine with 1.2.0. Maybe it’s a validator issue, but I’m using the same validator that GitHub uses already.

We have established that the used validator in question is outdated.

@sdruskat
Copy link
Member Author

sdruskat commented Feb 20, 2024

The problem has been reported as the validation library not resolving $def references in the schema, and thus not loading the relevant subschemas.

The main issue with this is that this is the same version of the validator that GitHub uses internally.
This may potentially result in breaking the GitHub citation widget if ruby-cff is update to work with CFF version 1.3.0 without updating the validation library.

Perhaps @arfon could advise how to handle this?
Ideally, GitHub would update the validation library in use, no?

@sdruskat
Copy link
Member Author

Transferring this to the ruby-cff repo.

@sdruskat sdruskat transferred this issue from citation-file-format/citation-file-format Feb 20, 2024
@arfon
Copy link
Collaborator

arfon commented Feb 20, 2024

@sdruskat @hainesr – does v1.2 of cff fix this (https://rubygems.org/gems/cff/versions/1.2.0)?

@hainesr
Copy link
Member

hainesr commented Feb 21, 2024

Hi @arfon, this isn't an issue with ruby-cff itself but one of its dependencies. json_schema is no longer maintained and doesn't support newer versions of the JSON Schema standard. CFF is now using some of those features.

There is talk in the json_schema issues [1] about directing people to use json_schemer instead - which is maintained and supports modern JSON Schema versions.

I was wondering what GitHub have done about this. Have you moved (or are you moving) to a new JSON Schema gem? If so I could take this opportunity to do the same.

[1] brandur/json_schema#129

@hainesr hainesr added this to the 2.0 milestone Feb 22, 2024
@hainesr hainesr self-assigned this Feb 22, 2024
@hainesr hainesr added the bug Something isn't working label Feb 22, 2024
@arfon
Copy link
Collaborator

arfon commented May 27, 2024

Seems like we're pegged to 0.20.9 still internally right now. I've asked around if we're planning on moving to a different gem but it doesn't seem to be a priority right now 😞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants