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

Will future versions support the parsing of validation rules for interface request parameters? #267

Closed
dearsource opened this issue May 20, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@dearsource
Copy link

dearsource commented May 20, 2022

Summary

Parsing validation rules for Spring-style interface parameters.
Brief explanation of the feature.

Basic Example

Example usage:

@Pattern(regexp = "^[\\u4e00-\\u9fa5\\w\\d][\\u4e00-\\u9fa5\\w\\d_]{0,62}[\\u4e00-\\u9fa5\\w\\d]$",
        message = "The name of the customized background image is invalid.")
@Range(min = 0, max = 1, message = "resolution must be in [0,1]")
private int resolution;

If the proposal involves a new or changed API, include a basic code example. Omit this section if it's not applicable.

Motivation

After generating the interface documentation, there is no need to manually add or modify the validation rules for each parameter. If the rules for input parameters are updated, the documentation can be regenerated without manual intervention for the validation rules. In the interface documentation, it is clearly visible which validation rules apply to different interface input parameters.

@dearsource dearsource added the enhancement New feature or request label May 20, 2022
@shalousun
Copy link
Collaborator

shalousun commented Aug 6, 2022

@dearsource In the future, we could consider extracting the JSR rules and appending them to the comments.

@shalousun shalousun changed the title 后续版本是否支持对接口请求参数的校验规则解析? Will future versions support the parsing of validation rules for interface request parameters? Jul 1, 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

3 participants