File tree Expand file tree Collapse file tree 2 files changed +63
-1
lines changed
modules/openapi-generator/src/test
java/org/openapitools/codegen/java Expand file tree Collapse file tree 2 files changed +63
-1
lines changed Original file line number Diff line number Diff line change @@ -3210,4 +3210,28 @@ public void testDuplicatedOperationId() {
32103210 );
32113211 }
32123212
3213- }
3213+ @ Test
3214+ public void testGenerateParameterId () {
3215+ final Path output = newTempFolder ();
3216+ final CodegenConfigurator configurator = new CodegenConfigurator ()
3217+ .setValidateSpec (false )
3218+ .setGeneratorName ("java" )
3219+ .setAdditionalProperties (Map .of (
3220+ CodegenConstants .API_PACKAGE , "xyz.abcdef.api"
3221+ ))
3222+ .setInputSpec ("src/test/resources/3_1/issue_20239.yaml" )
3223+ .setOutputDir (output .toString ().replace ("\\ " , "/" ));
3224+
3225+ new DefaultGenerator ().opts (configurator .toClientOptInput ()).generate ();
3226+
3227+ TestUtils .assertFileContains (
3228+ output .resolve ("src/main/java/xyz/abcdef/api/ATagApi.java" ),
3229+ " getCall(String pathParameter, Integer queryParameter, final ApiCallback _callback)"
3230+ );
3231+
3232+ TestUtils .assertFileNotContains (
3233+ output .resolve ("src/main/java/xyz/abcdef/api/ATagApi.java" ),
3234+ " getCall(Integer queryParameter, final ApiCallback _callback)"
3235+ );
3236+ }
3237+ }
Original file line number Diff line number Diff line change 1+ openapi : 3.1.0
2+ info :
3+ title : API Overview
4+ version : " v1"
5+ description : description
6+
7+ tags :
8+ - name : aTag
9+
10+ paths :
11+ " /path/{path_parameter} " :
12+ parameters :
13+ - $ref : " #/components/parameters/path_parameter"
14+ get :
15+ tags :
16+ - aTag
17+ operationId : get
18+ parameters :
19+ - $ref : " #/components/parameters/query_parameter"
20+ responses :
21+ " 200 " :
22+ description : no body
23+ components :
24+ parameters :
25+ path_parameter :
26+ name : path_parameter
27+ in : path
28+ required : true
29+ schema :
30+ type : string
31+
32+ query_parameter :
33+ name : query_parameter
34+ in : query
35+ schema :
36+ type : integer
37+ minimum : 0
38+ default : 0
You can’t perform that action at this time.
0 commit comments