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

optimize: optimize the error message of the required constraint for binding #1119

Merged
merged 2 commits into from
May 28, 2024

Conversation

haoxins
Copy link
Contributor

@haoxins haoxins commented May 17, 2024

What type of PR is this?

optimize

Check the PR title.

  • This PR title match the format: <type>(optional scope): <description>
  • The description of this PR title is user-oriented and clear enough for others to understand.
  • Attach the PR updating the user documentation if the current PR requires user awareness at the usage level. User docs repo

(Optional) Translate the PR title into Chinese.

(Optional) More detailed description for this PR(en: English/zh: Chinese).

en:

If we have the binding or params definition:

type Params struct {
	AccId string `query:"accountId,required"
}

The current error message will be:

"'AccId' field is a 'required' parameter, but the request does not have this parameter"

This will be confused for the API caller.

The error message will be

"'accountId' field is a 'required' parameter, but the request does not have this parameter"

with this change.

zh(optional):

(Optional) Which issue(s) this PR fixes:

(Optional) The PR that updates user documentation:

@haoxins haoxins requested review from a team as code owners May 17, 2024 05:31
@haoxins haoxins changed the title binding: fix the error message of the query required constraint fix(binding): fix the error message of the query required constraint May 17, 2024
@FGYFFFF
Copy link
Contributor

FGYFFFF commented May 17, 2024

可以看看其他地方的 Required 校验是否也有类似的 case,可以一并修改

@haoxins haoxins changed the title fix(binding): fix the error message of the query required constraint fix(binding): fix the error message of the required constraint May 17, 2024
@haoxins haoxins changed the title fix(binding): fix the error message of the required constraint fix(binding): fix the error message of the required constraint May 17, 2024
@haoxins
Copy link
Contributor Author

haoxins commented May 17, 2024

可以看看其他地方的 Required 校验是否也有类似的 case,可以一并修改

done

@FGYFFFF FGYFFFF changed the title fix(binding): fix the error message of the required constraint optimize: fix the error message of the required constraint for binding May 24, 2024
@FGYFFFF FGYFFFF changed the title optimize: fix the error message of the required constraint for binding optimize: optimize the error message of the required constraint for binding May 24, 2024
@welkeyever welkeyever merged commit 413ba29 into cloudwego:develop May 28, 2024
14 checks passed
@haoxins haoxins deleted the fix-dinding branch May 28, 2024 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants