File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
modules/swagger-jaxrs/src/test/java/io/swagger Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -522,6 +522,12 @@ public void scanResourceWithApiOperationNickname() {
522522 @ Test (description = "scan a resource with custom operation nickname" )
523523 public void scanClassWithExamplePost () {
524524 Swagger swagger = getSwagger (ClassWithExamplePost .class );
525- Json .prettyPrint (swagger );
525+ Parameter param = swagger .getPaths ().get ("/external/info" ).getPost ().getParameters ().get (0 );
526+ Json .prettyPrint (param );
527+ BodyParameter bp = (BodyParameter ) param ;
528+ assertNotNull (bp .getExamples ());
529+ assertTrue (bp .getExamples ().size () == 1 );
530+ String value = bp .getExamples ().get ("foo" );
531+ assertEquals ("bar" , value );
526532 }
527533}
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ public class ClassWithExamplePost {
1212 @ ApiOperation (value = "test." )
1313 @ POST
1414 public void postTest (@ ApiParam (value = "test" ,
15- examples = @ Example (value = {@ ExampleProperty (mediaType ="fun " , value ="bar" )})) ArrayList <String > tenantId ) {
15+ examples = @ Example (value = {@ ExampleProperty (mediaType ="foo " , value ="bar" )})) ArrayList <String > tenantId ) {
1616 return ;
1717 }
1818}
You can’t perform that action at this time.
0 commit comments