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

[jersey2-experimental] Generated Java code does not compile when using AnyType #6237

Closed
5 of 6 tasks
sebastien-rosset opened this issue May 9, 2020 · 6 comments
Closed
5 of 6 tasks

Comments

@sebastien-rosset
Copy link
Contributor

sebastien-rosset commented May 9, 2020

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)
Description

When using the OAS document provided as a link, the generated Java code with the jersey2-experimental library does not compile.

[ERROR]   location: class AaaAbstractAuditRecord
[ERROR] /home/serosset/goroot/src/bitbucket-eng-sjc1.cisco.com/an/ui-an-apidocs/.build/sdk/intersight_java/src/main/java/com/cisco/intersight/client/model/AaaAbstractAuditRecord.java:[253,39] error: cannot find symbol
[ERROR]   symbol:   class oas_any_type_not_mapped
[ERROR]   location: class AaaAbstractAuditRecord
openapi-generator version

master branch 5/9

OpenAPI declaration file content or url

Full OAS document:
https://github.com/CiscoM31/intersight-openapi/blob/master/intersight-openapi-v3.yaml

Command line used for generation
Steps to reproduce

java -jar ./modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -o tmp -i intersight-openapi-v3.yaml -c codegen/config.json

Configuration:

library: jersey2-experimental
java8: true
dateLibrary: java8
fullJavaUtil: false
Related issues/PRs
Suggest a fix
@sebastien-rosset
Copy link
Contributor Author

@wing328

@sebastien-rosset sebastien-rosset changed the title [jersey2-experimental] Generated Java code does not compile when using "type: 'null'" [jersey2-experimental] Generated Java code does not compile when using AnyType May 9, 2020
@wing328
Copy link
Member

wing328 commented May 11, 2020

I've filed #6246 to fix AnyType mapping but still got the following compilation errors (may not be related to AnyType):

[ERROR]   location: class AssetDeviceConnectionRelationship
[ERROR] /private/tmp/java2jersey2/src/main/java/org/openapitools/client/model/RecoveryBackupProfileRelationship.java:[65,49] error: cannot find symbol
[ERROR]   symbol:   class ModelNull
[ERROR]   location: class RecoveryBackupProfileRelationship
[ERROR] /private/tmp/java2jersey2/src/main/java/org/openapitools/client/model/RecoveryBackupProfileRelationship.java:[83,32] error: cannot find symbol
[ERROR]   symbol:   class ModelNull
[ERROR]   location: class RecoveryBackupProfileRelationship
[ERROR] /private/tmp/java2jersey2/src/main/java/org/openapitools/client/model/ManagementControllerRelationship.java:[69,49] error: cannot find symbol
[ERROR]   symbol:   class ModelNull
[ERROR]   location: class ManagementControllerRelationship
[ERROR] /private/tmp/java2jersey2/src/main/java/org/openapitools/client/model/ManagementControllerRelationship.java:[90,32] error: cannot find symbol
[ERROR]   symbol:   class ModelNull
[ERROR]   location: class ManagementControllerRelationship

So I will need to take a deeper look to see what's causing the compilation errors.

@wing328
Copy link
Member

wing328 commented May 11, 2020

I found the issue. oneOf (and probably anyOf) doesn't support null type at the moment. Will file a fix shortly to make it work with null

@wing328
Copy link
Member

wing328 commented May 11, 2020

Closing this one as the AnyType issue has been fixed.

I've opened #6257 to track the null support in oneOf/anyOf in the Java (jersey2-experimental) client instead

@wing328 wing328 closed this as completed May 12, 2020
@LXMJXHN
Copy link

LXMJXHN commented Jul 12, 2021

How exactly did you fix the problem? I have the same issue and don't know how I can solve the problem...

@CyberSteve738
Copy link

@wing328 I have the same question as @JohnLimHTL ! how was it solved?

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

No branches or pull requests

4 participants