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

JsonSchemaUtils needs case statement for specVersion DRAFT_2020_12 #3284

Open
bgoldiing opened this issue Sep 19, 2024 · 3 comments
Open

JsonSchemaUtils needs case statement for specVersion DRAFT_2020_12 #3284

bgoldiing opened this issue Sep 19, 2024 · 3 comments

Comments

@bgoldiing
Copy link

I've added config.put("json.schema.spec.version", "DRAFT_2020_12") to by Producer properties but schema that generaeted is DRAFT_07. DRAFT_2020_12 is a allow version schema should be generated with the correct version.

To fix looks like JsonSchemaUtils needs a case for DRAFT_2020_12 (see ~ line 190):

 switch (specVersion) {
      case DRAFT_4:
        draft = JsonSchemaDraft.DRAFT_04;
        break;
      case DRAFT_6:
        draft = JsonSchemaDraft.DRAFT_06;
        break;
      case DRAFT_7:
        draft = JsonSchemaDraft.DRAFT_07;
        break;
      case DRAFT_2019_09:
        draft = JsonSchemaDraft.DRAFT_2019_09;
        break;
      default:
        draft = JsonSchemaDraft.DRAFT_07;
        break;
    }
@rayokota
Copy link
Member

Thanks @bgoldiing , unfortunately the third-party library that we are using does not yet support draft 2020-12 https://github.com/mbknor/mbknor-jackson-jsonSchema

@bgoldiing
Copy link
Author

I submitted ticket: mbknor/mbknor-jackson-jsonSchema#185 to to get jackson library updated to support latest spec.

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

No branches or pull requests

2 participants