[
https://issues.apache.org/jira/browse/THRIFT-5423?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Sylwester Lachiewicz resolved THRIFT-5423.
------------------------------------------
Fix Version/s: 0.18.0
Resolution: Fixed
IDL parameter validation exists in the compiler:
[validator_parser.cc|https://github.com/apache/thrift/blob/master/compiler/cpp/src/thrift/generate/validator_parser.cc]
parses the validation annotations, with the Go generator as its first
consumer, landed in
[d5927a96|https://github.com/apache/thrift/commit/d5927a96019154fa590c38f3a7ca70275af11b3c]
(committed by Yuxuan Wang, September 2021); first released in 0.18.0.
Extending validation to additional languages is future work best filed per
language. Resolving as Fixed.
> Support parameter validation in IDL
> -----------------------------------
>
> Key: THRIFT-5423
> URL: https://issues.apache.org/jira/browse/THRIFT-5423
> Project: Thrift
> Issue Type: Improvement
> Components: Build Process
> Reporter: duanyi
> Priority: Major
> Labels: annotation, validation
> Fix For: 0.18.0
>
> Attachments: thrift-parameter-validation-proposal.md
>
> Original Estimate: 672h
> Time Spent: 14h 20m
> Remaining Estimate: 657h 40m
>
> I notice that Thrift IDL has no user-defined parameter validating mechanism
> at present, which is a common need for web services. As for Protobuf, the
> parameter validation gets community supports like PGV
> ([protoc-gen-validate|https://github.com/envoyproxy/protoc-gen-validate]),
> benefiting from its strong plugin mechanism. If we can use build tools to
> generate codes for simple and unchangeable constraint, the web service will
> be more robust and developers will benefit from lighter work. Take a
> long-term view, auto-generated parameter validation may be a step towards
> code-less web services.
> Here I propose the *Validation Annotation* for meeting this need.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)