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

ValidationErrors adds message to the fieldName #17164

Closed
wezell opened this issue Sep 5, 2019 · 2 comments
Closed

ValidationErrors adds message to the fieldName #17164

wezell opened this issue Sep 5, 2019 · 2 comments

Comments

@wezell
Copy link
Contributor

@wezell wezell commented Sep 5, 2019

When our APIs return a validation error like this:

 throw new DotContentletValidationException(message);

the validation mapper mistakenly adds the message as the fieldName value rather than the message value, which results in a response that looks like this and is obviously wrong.

{
	"errors": [{
		"errorCode": "unknown",
		"message": null,
		"fieldName": "The Key Tag &quot;retiree&quot; is in use by another Persona.<br/>Please rename the Persona or manually edit the Key Tag."
	}],
	"entity": "",
	"messages": [],
	"i18nMessagesMap": {},
	"permissions": []
}

The response should look like:

{
	"errors": [{
		"errorCode": "unknown",
		"message": "The Key Tag &quot;firstTimeInvestor&quot; is in use by another Persona.<br/>Please rename the Persona or manually edit the Key Tag.",
		"fieldName": null
	}],
	"entity": "",
	"messages": [],
	"i18nMessagesMap": {},
	"permissions": []
}
@wezell wezell added this to the Cody Current milestone Sep 5, 2019
wezell added a commit that referenced this issue Sep 5, 2019
@jgambarios

This comment has been minimized.

Copy link
Contributor

@jgambarios jgambarios commented Sep 5, 2019

PR: #17165

jgambarios added a commit that referenced this issue Sep 5, 2019
@john-thomas-dotcms john-thomas-dotcms added this to To Do in Documentation via automation Sep 5, 2019
@bryanboza bryanboza added this to CODY in QA Sep 6, 2019
@bryanboza

This comment has been minimized.

Copy link
Collaborator

@bryanboza bryanboza commented Sep 10, 2019

Fixed, tested on master // Postgres // FF

@bryanboza bryanboza added Passed QA and removed Needs QA labels Sep 10, 2019
@bryanboza bryanboza moved this from CODY to FOX in QA Sep 10, 2019
@bryanboza bryanboza moved this from FOX to Done in QA Sep 10, 2019
@wezell wezell closed this Sep 10, 2019
@john-thomas-dotcms john-thomas-dotcms moved this from To Do to Dev Complete in Documentation Sep 18, 2019
@john-thomas-dotcms john-thomas-dotcms moved this from Dev Complete to Documented in Documentation Sep 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
QA
  
Done
Documentation
  
Documented
4 participants
You can’t perform that action at this time.