[
https://issues.apache.org/jira/browse/THRIFT-5423?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
duanyi updated THRIFT-5423:
---------------------------
Description:
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.
was:
We 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 we propose the *Validation Annotation* for meeting this need.
> 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
> Attachments: thrift-parameter-validation-proposal.md
>
> Original Estimate: 672h
> Remaining Estimate: 672h
>
> 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.3.4#803005)