raml-for-jax-rs icon indicating copy to clipboard operation
raml-for-jax-rs copied to clipboard

Cross-Referenced Json Schema taking name of first field encountered

Open aaron-axisa opened this issue 8 years ago • 0 comments

Assume i have this schema structure

SchemaA.json:

{
  "properties": {
     "myValA": {  "$ref" : "file:path/to/Common.json"}
  }
}

SchemaB.json:

{
  "properties": {
     "myValB": {  "$ref" : "file:path/to/Common.json"}
  }
}

Common.json:

{ 
  "id" : "MyCommonUniqueName"
}

In this case, the Java Pojo generated for Common.json is called either "MyValA.java" or "MyValB.java" as it is called after the first property field name it encounters

I believe it would make sense for it to be called either "MyCommonUniqueName.java" (from the id) or possibly "Common.java" (from the file name)

A solution would be to bind the schema using a "javaType" but this would bind it specifically to my package structure and hence not make the schema redistributable

aaron-axisa avatar Feb 03 '17 13:02 aaron-axisa