File tree Expand file tree Collapse file tree 2 files changed +35
-1
lines changed
modules/swagger-jaxrs/src/test/java/io/swagger Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Original file line number Diff line number Diff line change 5252import io .swagger .resources .SimpleResourceWithoutAnnotations ;
5353import io .swagger .resources .SimpleSelfReferencingSubResource ;
5454import io .swagger .resources .TaggedResource ;
55+ import io .swagger .resources .NicknamedOperation ;
5556
5657import org .testng .annotations .Test ;
5758
@@ -337,7 +338,7 @@ public void scanSimpleSelfReferencingSubResource() {
337338 retrieve = getGet (swagger , "/sub/recurse2" );
338339 assertNotNull (retrieve );
339340 assertEquals (retrieve .getParameters ().size (), 0 );
340- }
341+ }
341342
342343 @ Test (description = "scan resource with ApiOperation.code() value" )
343344 public void scanResourceWithApiOperationCodeValue () {
@@ -527,4 +528,17 @@ public void checkResponseModelsProcessing() {
527528 }
528529 }
529530 }
531+
532+ @ Test (description = "scan a resource with custom operation nickname" )
533+ public void scanResourceWithApiOperationNickname () {
534+ Swagger swagger = getSwagger (NicknamedOperation .class );
535+ assertEquals (swagger .getPaths ().size (), 1 );
536+
537+ assertNotNull (swagger .getPaths ().get ("/external/info" ));
538+
539+ Operation op = swagger .getPaths ().get ("/external/info" ).getGet ();
540+ assertNotNull (op );
541+
542+ assertEquals (op .getOperationId (), "getMyNicknameTest" );
543+ }
530544}
Original file line number Diff line number Diff line change 1+ package io .swagger .resources ;
2+
3+ import io .swagger .annotations .Api ;
4+ import io .swagger .annotations .ApiOperation ;
5+ import io .swagger .annotations .ApiParam ;
6+
7+ import javax .ws .rs .GET ;
8+ import javax .ws .rs .Path ;
9+ import javax .ws .rs .core .Response ;
10+ import java .util .ArrayList ;
11+
12+ @ Api (value = "/external/info/" )
13+ @ Path ("external/info/" )
14+ public class NicknamedOperation {
15+ @ ApiOperation (value = "test" , nickname = "getMyNicknameTest" )
16+ @ GET
17+ public Response .Status getTest (@ ApiParam (value = "test" ) ArrayList <String > tenantId ) {
18+ return Response .Status .OK ;
19+ }
20+ }
You can’t perform that action at this time.
0 commit comments