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

JacksonXmlRootElement import not added for `allOf` swagger types. #644

Open
conniey opened this issue Jun 26, 2020 · 0 comments
Open

JacksonXmlRootElement import not added for `allOf` swagger types. #644

conniey opened this issue Jun 26, 2020 · 0 comments
Labels
v4

Comments

@conniey
Copy link
Member

@conniey conniey commented Jun 26, 2020

Steps to reproduce:

  1. build v4 branch.
  2. Add some types that use "allOf".
    1. Full swagger.json: https://github.com/YijunXieMS/azure-rest-api-specs-pr/blob/servicebus_mgmt/specification/servicebus/data-plane/servicebus-swagger.json
  3. Generate with settings below.

Expected

Compilable code is generated.

Actual

Import for @JacksonXmlRootElement is missing, so it can't compile.

Code

swagger.json

{
  "definitions": {
    "RuleAction": {
      "type":"object",
      "discriminator": "type",
      "xml": {
        "name": "Action",
        "namespace": "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect"
      },
      "properties": {
        "type": {
          "type": "string",
          "xml": {
            "attribute": true,
            "prefix": "xsi",
            "namespace": "http://www.w3.org/2001/XMLSchema-instance"
          }
        }
      }
    },
    "SqlRuleAction": {
      "type": "object",
      "allOf": [
        {
          "$ref": "#/definitions/RuleAction"
        },
        {
          "type": "object",
          "properties": {
            "SqlExpression": {
              "type": "string",
              "xml": {
                "namespace": "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect"
              }
            }
          }
        }
      ]
    },
    "EmptyRuleAction": {
      "type": "object",
      "allOf": [
        {"$ref": "#/definitions/RuleAction"}
      ]
    },
  }
}

README.md

input-file: $\azure-rest-api-specs-pr\specification\servicebus\data-plane\servicebus-swagger.json
java: true
output-folder: ..\
generate-client-as-impl: true
namespace: com.azure.messaging.servicebus
generate-client-interfaces: false
sync-methods: none
license-header: MICROSOFT_MIT_SMALL
add-context-parameter: true
models-subpackage: implementation.models
context-client-method-parameter: true
enable-xml: true
@conniey conniey added the v4 label Jun 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.