File tree Expand file tree Collapse file tree 3 files changed +62
-1
lines changed
swagger-core/src/test/scala
swagger-jaxrs/src/test/scala Expand file tree Collapse file tree 3 files changed +62
-1
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,14 @@ class XmlModelTest extends FlatSpec with Matchers {
5252 }
5353}
5454
55+ @ RunWith (classOf [JUnitRunner ])
56+ class XmlModelTest2 extends FlatSpec with Matchers {
57+ it should " honor xml annotations" in {
58+ val schemas = ModelConverters .getInstance().readAll(classOf [Message ])
59+ Json .prettyPrint(schemas)
60+ }
61+ }
62+
5563@ XmlRootElement (name = " monster" )
5664class Monster {
5765 @ BeanProperty
Original file line number Diff line number Diff line change 1+ package models ;
2+
3+ import com .fasterxml .jackson .annotation .JsonIgnore ;
4+
5+ import java .io .Serializable ;
6+ import java .util .ArrayList ;
7+ import java .util .Arrays ;
8+ import java .util .Calendar ;
9+ import java .util .Date ;
10+ import java .util .List ;
11+ import javax .xml .bind .annotation .XmlID ;
12+ import javax .xml .bind .annotation .XmlAccessType ;
13+ import javax .xml .bind .annotation .XmlAccessorType ;
14+ import javax .xml .bind .annotation .XmlAttribute ;
15+ import javax .xml .bind .annotation .XmlElement ;
16+ import javax .xml .bind .annotation .XmlRootElement ;
17+
18+ @ XmlRootElement (name = "message" )
19+ // @XmlAccessorType(XmlAccessType.NONE)
20+ public class Message implements Serializable {
21+ @ XmlAttribute
22+ private String id ;
23+
24+ @ XmlAttribute
25+ private Date date ;
26+
27+ @ XmlElement (name = "body" )
28+ private String body ;
29+
30+ private List <String > tag ;
31+
32+ public Message () {}
33+
34+ public void setId (String id ) {
35+ this .id = id ;
36+ }
37+
38+ public String getId () {
39+ return this .id ;
40+ }
41+
42+ public void setUser (String person ) {}
43+
44+ @ JsonIgnore
45+ public String getUserName () {
46+ return null ;
47+ }
48+
49+ @ XmlElement
50+ public List <String > getTags () {
51+ return new ArrayList <String >();
52+ }
53+ }
Original file line number Diff line number Diff line change @@ -354,7 +354,7 @@ class SimpleScannerTest extends FlatSpec with Matchers {
354354 param.isInstanceOf [PathParameter ] should be (true )
355355 }
356356
357- it should " verify top-level path params per #1085 " in {
357+ it should " verify top-level auth #1041 " in {
358358 val swagger = new Reader (new Swagger ()).read(classOf [Resource1041 ])
359359 val path1 = swagger.getPaths().get(" /external/info/path1" ).getGet()
360360 val security1 = path1.getSecurity()
You can’t perform that action at this time.
0 commit comments