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

Add package when javaType is not a fully qualified name #1054

Merged
merged 2 commits into from
Dec 12, 2019

Conversation

eltabo
Copy link

@eltabo eltabo commented Dec 5, 2019

I am working in a POC with OCPP 1.6/2.0 that use json schemas with a not fully qualified javatype (example attacched). May be useful check if a specified javatype is fqn or not and hence add the package name if needed.

@joelittlejohn joelittlejohn added this to the 1.0.2 milestone Dec 6, 2019
@joelittlejohn joelittlejohn changed the title Allow no fqn javatypes Add package when javaType is not a fully qualified name Dec 6, 2019
@joelittlejohn
Copy link
Owner

Hi @eltabo. Thanks for submitting this. I think this is a good change, but we need an integration test that checks this behaviour before we can merge this PR. Could you add one?

@eltabo
Copy link
Author

eltabo commented Dec 12, 2019

I have added some integration tests.

@brydesigns
Copy link

brydesigns commented Jun 8, 2022

So in 1.1.1, "javaType":"Foo" produces com.example.Foo, "javaType":"subpackage.Foo" and "javaType":".subpackage.Foo" both produce subpackage.Foo, and I still have no idea how to produce com.example.subpackage.Foo.... I'm using <sourceSortOrder>FILES_FIRST</sourceSortOrder> because I have a subdirectory schema that incorrectly packages a "$ref":"../bar.json" reference, so that might be affecting my results (OS or SUBDIRS_FIRST do at least create subpackage).

  • subpackage/foo.json (javaType=Foo, has a reference to ../bar.json)
  • bar.json (javaType=Bar)
  • foo-bar.json (javaType=FooBar, has a reference to subpackage/foo.json)

targetPackage=com.example

No sourceSortOrder:

  • com.example.FooBar
  • com.example.subpackage.Foo
  • com.example.subpackage.Bar

Files first:

  • com.example.FooBar
  • com.example.Foo
  • com.example.Bar

What I would prefer:

  • com.example.FooBar
  • com.example.Bar
  • com.example.subpackage.Foo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants