go-zero icon indicating copy to clipboard operation
go-zero copied to clipboard

optional in api syntax

Open ThanksSirAlex opened this issue 3 years ago • 3 comments

Is your feature request related to a problem? Please describe. In most cases a params in api request is optional. Usually we only need it required if necessary and in most framework the tag is required not optional. It's super weird

Describe the solution you'd like I think a required tag is more reasonable.

ThanksSirAlex avatar Sep 14 '23 02:09 ThanksSirAlex

I think the difference is that with optional tag means pre-validation, while with required tag means post-validation.

I prefer stricter API defininition.

kevwan avatar Oct 14 '23 14:10 kevwan

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Oct 23 '24 02:10 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Jan 23 '25 02:01 github-actions[bot]