Skip to content

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

Open

Description

@sdruskat

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.

Activity

  1. sdruskat commented on Feb 20, 2024

    @sdruskat
    MemberAuthor

    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?

  2. sdruskat commented on Feb 20, 2024

    @sdruskat
    MemberAuthor

    Transferring this to the ruby-cff repo.

  3. arfon commented on Feb 20, 2024

    @arfon
    Collaborator
  4. hainesr commented on Feb 21, 2024

    @hainesr
    Member

    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

  5. added this to the 2.0 milestone on Feb 22, 2024
  6. self-assigned this
    on Feb 22, 2024
  7. arfon commented on May 27, 2024

    @arfon
    Collaborator

    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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions