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

Inflector incorrectly singularizes Address to Addres #244

Closed
sharathgithub opened this issue Sep 16, 2014 · 5 comments
Closed

Inflector incorrectly singularizes Address to Addres #244

sharathgithub opened this issue Sep 16, 2014 · 5 comments
Milestone

Comments

@sharathgithub
Copy link

Hi jsonschema2pojo team,

jsonschema2pojo-core-0.4.3.jar API is not generating the POJO Class Name Properly, generated class Name[com.example.PostalAddres.java] is not equal to Object Name[PostalAddress] in the Schema, it is trimming the 's' in end of a string[ObjectName], this issue is creating inconsistent between the names and it is only happening when the object name[end of the name] has "ss".

Schema Used :

{
  "type":"object",
  "$schema": "http://json-schema.org/draft-03/schema#",
  "title": "Party",
  "name": "Party",
  "description": "Party",
  "required":false,
  "properties":
     { "PostalAddress": 
      {
         "type":"array",
         "name": "PostalAddress",
         "required":false,
         "items":
            {
              "type":"object",
              "title": "PostalAddress",
              "name": "PostalAddress",
              "required":false,
              "properties":
              {
                "addressType": 
                {
                  "type":"string",
                  "name": "addressType",
                  "required":false
                },
                "addressLineOne": 
                {
                  "type":"string",
                  "name": "addressLineOne",
                  "required":false
                }  ,
                "cityName": 
                {
                  "type":"string",
                  "name": "cityName",
                  "required":false
                }
              }
            }
      }
     }
}

Please find the problem in the screens,
JSON Schema View:
schema_screen

POJO Class View:
java_screen

Thanks in advance.

Regards
SharathG

@joelittlejohn
Copy link
Owner

Thanks for reporting this. We obviously need to add a special case to the inflector for the word 'address'. I'll do this for the next release.

@joelittlejohn joelittlejohn added this to the 0.4.6 milestone Sep 28, 2014
@sharathgithub
Copy link
Author

Dear jsonschema2pojo team,
Please give the clarification on this solution, our requirement demanding to get the file name as "PostalAddress.java" but it is not happening, please give me the more clarification to achieve this task and also about your solution.

Thanks & regards
SharathG

@joelittlejohn
Copy link
Owner

@sharathgithub This fix hasn't been released, it will be released in 0.4.6.

@sharathgithub
Copy link
Author

Dear jsonschema2pojo team,
Please give me the release date for 0.4.6 version, we are getting lot of problems due to this problem.

Thanks in advance.

Regards
SharathG

@joelittlejohn joelittlejohn changed the title Array Of Objects POJO Class Name Not generating Properly, POJO Class name and Object name in the JSON Schema are not equal Inflector incorrectly singularizes Address to Addres Oct 31, 2014
@joelittlejohn
Copy link
Owner

0.4.6 is released.

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