11package io .swagger .jackson ;
22
3+ import com .fasterxml .jackson .annotation .JsonIgnore ;
34import com .fasterxml .jackson .annotation .JsonProperty ;
45import io .swagger .annotations .ApiModel ;
56import io .swagger .converter .ModelConverter ;
1415import javax .xml .bind .annotation .XmlAccessorType ;
1516import javax .xml .bind .annotation .XmlAttribute ;
1617import javax .xml .bind .annotation .XmlElement ;
18+ import javax .xml .bind .annotation .XmlElementRef ;
19+ import javax .xml .bind .annotation .XmlElementRefs ;
1720import javax .xml .bind .annotation .XmlElementWrapper ;
1821import javax .xml .bind .annotation .XmlRootElement ;
1922import static org .testng .Assert .assertEquals ;
@@ -83,6 +86,12 @@ public void testReadingXmlAccessorTypeNone() throws Exception {
8386 assertNull (impl .getProperties ().get ("b" ));
8487
8588 assertNotNull (impl .getProperties ().get ("c" ));
89+
90+ assertNotNull (impl .getProperties ().get ("d" ));
91+
92+ assertNotNull (impl .getProperties ().get ("e" ));
93+
94+ assertNotNull (impl .getProperties ().get ("f" ));
8695 }
8796
8897 @ XmlRootElement (name = "xmlDecoratedBean" )
@@ -97,6 +106,15 @@ static class XmlDecoratedBeanXmlAccessorNone {
97106
98107 @ XmlAttribute
99108 public String c ;
109+
110+ @ XmlElementRef
111+ public XmlDecoratedBean d ;
112+
113+ @ XmlElementRefs (value = {@ XmlElementRef })
114+ public List <XmlDecoratedBean > e ;
115+
116+ @ JsonProperty
117+ public int f ;
100118 }
101119
102120 @ Test
@@ -114,8 +132,12 @@ public void testReadingXmlAccessorTypePublic() throws Exception {
114132 final Property propertyA = impl .getProperties ().get ("a" );
115133 assertNotNull (propertyA );
116134
117- Property propertyB = impl .getProperties ().get ("b" );
135+ final Property propertyB = impl .getProperties ().get ("b" );
118136 assertNotNull (propertyB );
137+
138+ final Property propertyC = impl .getProperties ().get ("c" );
139+ assertNull (propertyC );
140+
119141 }
120142
121143 @ XmlRootElement (name = "xmlDecoratedBean" )
@@ -126,6 +148,9 @@ static class XmlDecoratedBeanXmlAccessorPublic {
126148 public int a ;
127149
128150 public String b ;
151+
152+ @ JsonIgnore
153+ public String c ;
129154 }
130155
131156}
0 commit comments