Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add common parameters to the interface. #132

Closed
ZhongCW opened this issue Jul 13, 2021 · 6 comments
Closed

Add common parameters to the interface. #132

ZhongCW opened this issue Jul 13, 2021 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@ZhongCW
Copy link

ZhongCW commented Jul 13, 2021

How should I configure common request parameters in smart-doc.json (I handle these parameters through an interceptor, and they are not passed into the controller)? Similar to the requestHeaders configuration item (expecting requestParams), but it is not found.

@ZhongCW ZhongCW changed the title 给借口添加公共参数 给接口添加公共参数 Jul 13, 2021
@ZhongCW
Copy link
Author

ZhongCW commented Jul 13, 2021

The customRequest/ResponseFields configuration seems unable to meet this requirement.

@netdied
Copy link
Collaborator

netdied commented Jul 13, 2021

requestBodyAdvice
Reference:
https://gitee.com/smart-doc-team/smart-doc/wikis/smart-doc%20maven%E6%8F%92%E4%BB%B6?sort_id=1791450
Supports only parameters marked with @RequestBody.

@ZhongCW
Copy link
Author

ZhongCW commented Jul 13, 2021

requestBodyAdvice
Reference:
https : //gitee.com/smart-doc-team/smart-doc/wikis/smart-doc%20maven%E6%8F%92%E4%BB%B6?sort_id = 1791450 Only
supports parameters marked with @RequestBody

Currently, it is only possible to configure common headers through requestHeaders, and I am unable to add common query parameters in the documentation.
Is there any plan to implement a feature for specifying parameter locations through global configuration?

For example:

"globalParameters": [
     "name": "Authorization",
     "type": "string",
     "parameterType": "query",  // Where to place the parameter: header, query, path, body.form
     "desc": "User token",
     "required": true,
     "value": "1"
]

@shalousun
Copy link
Collaborator

shalousun commented Jul 13, 2021

requestBodyAdvice
Reference:
https : //gitee.com/smart-doc-team/smart-doc/wikis/smart-doc%20maven%E6%8F%92%E4%BB%B6?sort_id = 1791450 Only
supports parameters marked with @RequestBody

Currently, it is only possible to configure common headers through requestHeaders, and I am unable to add common query parameters in the documentation.
Is there a plan to implement a feature for specifying parameter locations through global configuration?

For example:

"globalParameters": [
     "name": "Authorization",
     "type": "string",
     "parameterType": "query",  // Where to place the parameter: header, query, path, body.form
     "desc": "User token",
     "required": true,
     "value": "1"
]

Headers are already configured, so there's no need to set them again as header type.

@ZhongCW
Copy link
Author

ZhongCW commented Jul 14, 2021

requestBodyAdvice
Reference:
https : //gitee.com/smart-doc-team/smart-doc/wikis/smart-doc%20maven%E6%8F%92%E4%BB%B6?sort_id = 1791450 Only
supports parameters marked with @RequestBody

Currently, it is only possible to configure common headers through requestHeaders, and I am unable to add common query parameters in the documentation.
Is there a plan to implement a feature for specifying parameter locations through global configuration?

For example:

"globalParameters": [
     "name": "Authorization",
     "type": "string",
     "parameterType": "query",  // Where to place the parameter: header, query, path, body.form
     "desc": "User token",
     "required": true,
     "value": "1"
]

My situation is as follows: http://localhost/users?page=1&pageSize=10 Here, the parameters page and pageSize are handled by an interceptor and can be used when calling any interface; these two parameters do not appear on the controller.
I hope to be able to configure the page and pageSize parameters to be added to the query-parameters section of all APIs through configuration.

@chenqi146 chenqi146 self-assigned this Jul 14, 2021
chenqi146 added a commit to chenqi146/smart-doc that referenced this issue Jul 17, 2021
shalousun added a commit that referenced this issue Jul 17, 2021
feat: add requestParams for git #132
@chenqi146
Copy link
Collaborator

#133

chenqi146 added a commit to chenqi146/smart-doc that referenced this issue Jul 18, 2021
@shalousun shalousun added bug Something isn't working enhancement New feature or request and removed bug Something isn't working labels Dec 14, 2021
@shalousun shalousun changed the title 给接口添加公共参数 Add common parameters to the interface. Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants