@@ -1636,7 +1636,7 @@ private static ServiceModel ParseModel(AutoRestCompositeType autoRestCompositeTy
16361636 modelImports . Add ( "com.fasterxml.jackson.annotation.JsonProperty" ) ;
16371637 }
16381638
1639- if ( compositeTypeProperties . Any ( p => p . ModelType is AutoRestSequenceType ) )
1639+ if ( compositeTypeProperties . Any ( p => p . XmlIsWrapped ) )
16401640 {
16411641 modelImports . Add ( "com.fasterxml.jackson.annotation.JsonCreator" ) ;
16421642 }
@@ -2451,7 +2451,7 @@ public static JavaFile GetModelJavaFile(ServiceModel model, JavaSettings setting
24512451 foreach ( ServiceModelProperty property in model . Properties )
24522452 {
24532453 string xmlWrapperClassName = propertyXmlWrapperClassName ( property ) ;
2454- if ( settings . ShouldGenerateXmlSerialization && property . WireType is ListType )
2454+ if ( settings . ShouldGenerateXmlSerialization && property . IsXmlWrapper )
24552455 {
24562456 classBlock . PrivateStaticFinalClass ( xmlWrapperClassName , innerClass =>
24572457 {
@@ -2481,12 +2481,16 @@ public static JavaFile GetModelJavaFile(ServiceModel model, JavaSettings setting
24812481 string localName = settings . ShouldGenerateXmlSerialization ? property . XmlName : property . SerializedName ;
24822482 classBlock . Annotation ( $ "JacksonXmlProperty(localName = \" { localName } \" , isAttribute = true)") ;
24832483 }
2484+ else if ( settings . ShouldGenerateXmlSerialization && property . WireType is ListType && ! property . IsXmlWrapper )
2485+ {
2486+ classBlock . Annotation ( $ "JsonProperty(\" { property . XmlListElementName } \" )") ;
2487+ }
24842488 else if ( ! string . IsNullOrEmpty ( property . AnnotationArguments ) )
24852489 {
24862490 classBlock . Annotation ( $ "JsonProperty({ property . AnnotationArguments } )") ;
24872491 }
24882492
2489- if ( settings . ShouldGenerateXmlSerialization && property . WireType is ListType )
2493+ if ( settings . ShouldGenerateXmlSerialization && property . IsXmlWrapper )
24902494 {
24912495 classBlock . PrivateMemberVariable ( $ "{ xmlWrapperClassName } { property . Name } ") ;
24922496 }
@@ -2529,7 +2533,7 @@ public static JavaFile GetModelJavaFile(ServiceModel model, JavaSettings setting
25292533 string expression = $ "this.{ property . Name } ";
25302534 if ( sourceTypeName == targetTypeName )
25312535 {
2532- if ( settings . ShouldGenerateXmlSerialization && propertyType is ListType )
2536+ if ( settings . ShouldGenerateXmlSerialization && property . IsXmlWrapper )
25332537 {
25342538 methodBlock . Return ( $ "this.{ property . Name } .items") ;
25352539 }
@@ -2635,7 +2639,7 @@ public static JavaFile GetModelJavaFile(ServiceModel model, JavaSettings setting
26352639 }
26362640 else
26372641 {
2638- if ( settings . ShouldGenerateXmlSerialization && propertyType is ListType )
2642+ if ( settings . ShouldGenerateXmlSerialization && property . IsXmlWrapper )
26392643 {
26402644 methodBlock . Line ( $ "this.{ property . Name } = new { propertyXmlWrapperClassName ( property ) } ({ property . Name } );") ;
26412645 }
0 commit comments