-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: 🐛 correct parameter documentation for
@RequestBody
and unannot…
…ated form parameters Fixed an issue where unannotated parameters (e.g., BasePager) were incorrectly documented as part of the request body in API documentation when used alongside a @RequestBody parameter. These parameters are now correctly documented as query parameters. - Add ApiParamEnum to categorize API parameters (PATH, QUERY, BODY) - Implement logic to determine parameter type based on annotations and HTTP method - Update API documentation generation to use new parameter categorization - Refactor ApiMethodDoc and ApiParam classes for better parameter management - Improve handling of form data and query parameters in API requests Closes #965
- Loading branch information
1 parent
5443bb9
commit 7df92e6
Showing
6 changed files
with
258 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Copyright (C) 2018-2024 smart-doc | ||
* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package com.ly.doc.constants; | ||
|
||
/** | ||
* ParamEnum | ||
* | ||
* @author linwumingshi | ||
* @since 3.0.10 | ||
*/ | ||
public enum ApiParamEnum { | ||
|
||
/** | ||
* PathVariable,when param use `@PathVariable` annotation | ||
*/ | ||
PATH, | ||
|
||
/** | ||
* RequestParam | ||
*/ | ||
QUERY, | ||
|
||
/** | ||
* Body Param(from-data, x-www-form-urlencoded, raw(json)) | ||
*/ | ||
BODY, | ||
|
||
; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.