You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the maven configuration option propertyWordDelimiters set to: _-
And then using a schema such as the following:
{
"description":"New user information",
"type":"object",
"properties":{
"first_name":{"type":"string"},
"last_name":{"type":"string"},
"email":{"type":"string"},
"service_credentials":{
"type":"array",
"items":{
"type":"object",
"properties":{
"service":{"type":"string"}
}
}
},
"additional_info":{"type":"string"}
}
}
What is the expected output?
-A ServiceCredential object should be created to represent the array of objects that is attached to the main CreateUser object.
What do you see instead?
-An object named Service_credential is created instead of ServiceCredential. To me it seems like the propertyWordDelimiters flag is being ignored for inner objects/arrays.
What version of the product are you using? On what Java version? (On what
version of Maven/Ant if applicable?) v0.3.2 on Java 1.6
From [email protected] on August 27, 2012 20:47:20
Thanks for the detailed report Josh.
The problem is even simpler than you think. propertyWordDelimiters are not used when naming Java types, only when naming Java properties. This is a definite oversight and I'll look to get this fixed in 0.3.3.
From [email protected] on August 27, 2012 21:49:01
Thanks Joe. If I get a minute later today I'll checkout the code and see if I can fix it and send you a patch.
From [email protected] on August 27, 2012 21:52:44
That would be great. I think PropertyRule#capitalizeTrailingWords(String, char[]) needs to be pulled out into some kind of helper so that it can be used from ObjectRule too.
From [email protected] on August 29, 2012 21:26:15
I've merged your patches Josh, they both look great. I think you're code fits perfectly (style-wise) with the rest of the project. I've done some further (minor) refactoring to move the illegal char escaping into the name helper and fix some tiny formatter problems (e.g. tabs -> spaces).
I've expanded the Enum integration test to make sure that the new naming strategy is working as expected. Feel free to build the current master and see if everything is working well for you.
Original author: [email protected] (August 27, 2012 20:40:54)
What steps will reproduce the problem?
{
"description":"New user information",
"type":"object",
"properties":{
"first_name":{"type":"string"},
"last_name":{"type":"string"},
"email":{"type":"string"},
"service_credentials":{
"type":"array",
"items":{
"type":"object",
"properties":{
"service":{"type":"string"}
}
}
},
"additional_info":{"type":"string"}
}
}
What is the expected output?
-A ServiceCredential object should be created to represent the array of objects that is attached to the main CreateUser object.
What do you see instead?
-An object named Service_credential is created instead of ServiceCredential. To me it seems like the propertyWordDelimiters flag is being ignored for inner objects/arrays.
What version of the product are you using? On what Java version? (On what
version of Maven/Ant if applicable?) v0.3.2 on Java 1.6
Original issue: http://code.google.com/p/jsonschema2pojo/issues/detail?id=73
The text was updated successfully, but these errors were encountered: