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

Same class different name #1082

Conversation

sharkvan
Copy link

This is a fix for the linked feature request. Please give any feedback on the approach.

The basic concept is when using the config option for useTitleAsClassname, I will cache type objects by a sha key of their schema, then look up potential reuse by that sha key.

#1081

@@ -1,3 +1,19 @@
/**
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this changes because everytime the build ran they came back, so I thought it would be nice for everyone to not have to exclude these again.

@sharkvan
Copy link
Author

Hi @joelittlejohn, not trying to be pushy, but I was wondering if you had a chance to review this PR?

@joelittlejohn
Copy link
Owner

Hi Tim. I'm afraid I actually don't see us merging this one into the core of jsonschema2pojo, but thank you for sharing the code with others. We can't support every different idea that people have about the way they would like this plugin to act, because the maintenance burden (and multiplied complexity of all these different options) becomes huge.

If you want these various things to be understood as all referencing the same type, then you can use a $ref. This plugin understands that all refs to the same schema should reuse the same type.

@sharkvan
Copy link
Author

I understand. The reason I did this is because I cannot always control the schema I'm getting but they are essentially the same schema. There are tools out there the remove the $ref and replace it with the schema it references, removing any ability for tools like this one to do anything about it. But thank you for your consideration.

@sharkvan
Copy link
Author

@joelittlejohn, what would you think about merging the changes to the Schema class only so custom implementations of the the RuleFactory and the implementations it provides can have a hook into when the JType is set to the Schema class?

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

Successfully merging this pull request may close these issues.

2 participants