Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
babyfish-ct committed Oct 26, 2024
1 parent 5f07e6d commit 0165d61
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion project/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
group=org.babyfish.jimmer
version=0.9.2
version=0.9.3
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,15 @@ private ParameterImpl parameter(ApiParameter apiParameter, Parameter javaParamet
"path variable nor request body"
);
}
if (pathVariable != null && apiParameter.getType().isNullable()) {
throw new IllegalApiException(
"Illegal API method \"" +
method +
"\", its parameter \"" +
apiParameter.getName() +
"\" cannot be nullable type because it is path variable"
);
}

String defaultValue = parameterParser.defaultValue(javaParameter);
parameter.setDefaultValue(defaultValue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1113,6 +1113,7 @@ public void testTreeService() {
" parameters:\n" +
" - name: id\n" +
" in: path\n" +
" required: true\n" +
" schema:\n" +
" type: integer\n" +
" format: int64\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Tree<String> getStringTree(
@Api
@GetMapping("/treeNode/{id}")
@FetchBy("TREE_NODE_DETAIL_FETCHER") TreeNode getTreeNodeById(
@PathVariable("id") Long id
@PathVariable("id") long id
);

@Api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public void testService() {
" readonly name?: string | undefined\n" +
" }, \n" +
" 'getTreeNodeById': {\n" +
" readonly id?: number | undefined\n" +
" readonly id: number\n" +
" }, \n" +
" 'getSimpleRootNodes': {}\n" +
"}\n",
Expand Down

0 comments on commit 0165d61

Please sign in to comment.