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

[Feature request]: Compatibility with draft 2020-12 #81

Open
M-casado opened this issue Jan 22, 2025 · 1 comment
Open

[Feature request]: Compatibility with draft 2020-12 #81

M-casado opened this issue Jan 22, 2025 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@M-casado
Copy link
Contributor

Summary

As the JSON Schemas community evolves, the latest draft 2020-12 (5 years old!) is increasingly being used. There are not that many new features in this draft, but as it is, Biovalidator is incompatible with it.

This feature request is for Biovalidator to be compatible with the latest drafts. Ideally this would be done and maintained for every new draft of JSON Schemas.

Related topic

Other

Request motivation

I'm trying to reference JSON Schemas from other resources, but if they use the draft/2020-12, Biovalidator hangs when the schemas are being returned.

Use cases

  • Using draft/2020-12 natively in one's schemas
  • Referencing draft/2020-12 in other schemas

Examples

With a $ref to a JSON Schema draft/2020-12, it should return the schema and store it in cache as it does with earlier drafts.

Additional context

As of now, the logs of Biovalidator show the following:

2025-01-22T16:13:14.638Z [info] ---------------------------------------------
2025-01-22T16:13:14.639Z [info] ------------ ELIXIR biovalidator ------------
2025-01-22T16:13:14.639Z [info] ---------------------------------------------
2025-01-22T16:13:14.639Z [info] Started server on port 3020 with base URL /
2025-01-22T16:13:14.640Z [info] Server available at http://localhost:3020/
2025-01-22T16:13:14.640Z [info] PID file is available at ***/GitHub/biovalidator/server.pid
2025-01-22T16:13:14.640Z [info] Writing logs to: ***/GitHub/biovalidator/logs/
2025-01-22T16:13:23.305Z [warn] Compiling schema with empty schema $id. Schema will not be cached.
2025-01-22T16:13:23.648Z [info] Returning referenced schema from network : https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/refs/heads/main/models/json/beacon-v2-default-model/datasets/defaultSchema.json
2025-01-22T16:13:23.819Z [info] Returning referenced schema from network : https://json-schema.org/draft/2020-12/schema

In the terminal where I had Biovalidator deployed, it simply hung at the "fetching schema reference ..." step, over and over again.

@M-casado M-casado added the enhancement New feature or request label Jan 22, 2025
@M-casado
Copy link
Contributor Author

M-casado commented Jan 28, 2025

@theisuru, I've checked at least a few possible approaches for adding JSON Schema 2020-12 support in Biovalidator:

  1. Switch to json-sKema (the new fork by the Everit library’s main author):

    • It offers 2020-12 support out of the box, with a similar API to Everit’s original library.
    • The downside is that it’s relatively new and may have fewer examples, though it’s by the same developer.
  2. Adopt a different validator library with 2020-12 support (examples include):

  3. Wait for Everit json-schema to eventually support 2020-12, not ideal since... it’s unclear if or when that will happen.

All these approaches would involve:

  • Updating the dependency (in pom.xml or build.gradle).
  • Replacing the current validator instantiation and error-handling code.
  • Verifying that older draft schemas still validate as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants