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

Custom data type generated as object in 1.2.1 #1495

Closed
prndrsn opened this issue Mar 2, 2023 · 3 comments
Closed

Custom data type generated as object in 1.2.1 #1495

prndrsn opened this issue Mar 2, 2023 · 3 comments

Comments

@prndrsn
Copy link

prndrsn commented Mar 2, 2023

I'm not sure if this is a bug introduced with #1456 or if the new behaviour is expected.

We have this schema:

    "Content": {
        "type": [
            "object",
            "string"
        ],
        "additionalProperties": true,
        "description": "Contains the unstructured inventory contents."
    }

This used to generate a Content data type, but is now being generated as Object. Not sure if the new jsonschema2pojo behaviour is correct and we need to adapt, or if this is a fault in the fix for #1456

@joelittlejohn
Copy link
Owner

Yes, I think you're right about this being related to #1456.

How do you support a String value for this field if the value in Java is Content. Do you add a custom ser/deser implementation for this?

@prndrsn
Copy link
Author

prndrsn commented Mar 2, 2023

So, this is very very old code and after some internal discussion we have concluded that this was probably a mistake in our original schema declaration that just happened to work because of the old jsonschema2pojo behaviour combined with the fact that the value is actually always Object in our application.

@joelittlejohn
Copy link
Owner

I'm going to tentatively close this one.

@joelittlejohn joelittlejohn closed this as not planned Won't fix, can't repro, duplicate, stale Mar 2, 2023
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