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

anyof allof oneof not support #1649

Open
kspmmitt opened this issue Nov 25, 2024 · 5 comments
Open

anyof allof oneof not support #1649

kspmmitt opened this issue Nov 25, 2024 · 5 comments

Comments

@kspmmitt
Copy link

Hello,
Can you please help to know what is the behavior is java class generation api if json schema has anyof/oneof/allof/not tags?
Rgds,
Kamal

@unkish
Copy link
Collaborator

unkish commented Nov 25, 2024

Hi

At present these tags are ignored

@kspmmitt
Copy link
Author

kspmmitt commented Nov 26, 2024

Property which uses anyof is generated with jave type as Object. It is not ignored as it is said above or?

Also till when support for these is expected, any tentative date?

@unkish
Copy link
Collaborator

unkish commented Nov 26, 2024

Property which uses anyof is generated with jave type as Object.

Properties that use *Of will most likely be represented by Object as in:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "string_property": {
      "allOf": [{
          "properties": {
            "foo": {
              "type": "string"
            }
          },
          "required": ["foo"]
        }
      ]
    }
  }
}

Whilst following valid schema would not:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "allOf": [
    {
      "properties": {
        "foo": { "type": "string" }
      },
      "required": [ "foo" ]
    }
  ]
}

Also till when support for these is expected, any tentative date?

No tentative dates.

@njimenezotto
Copy link

Is there any workaround possible to take into account *Of by making a custom RuleFactory?

@unkish
Copy link
Collaborator

unkish commented Nov 26, 2024

Is there any workaround possible to take into account *Of by making a custom RuleFactory?

Haven't tried all variants out though it could be, this really depends on the use-case(s).

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

3 participants