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

Update some entity processing errors to 400.28 #854

Closed
ktuite opened this issue May 3, 2023 · 1 comment · Fixed by #895
Closed

Update some entity processing errors to 400.28 #854

ktuite opened this issue May 3, 2023 · 1 comment · Fixed by #895
Assignees
Labels
entities Multiple Encounter workflows

Comments

@ktuite
Copy link
Member

ktuite commented May 3, 2023

PR #844 introduces a new Problem Problem.user.invalidEntity (400.28) to return when creating an entity from JSON fails because of some formatting or validation problem. New code around JSON entity extraction uses this problem.

Many of the previous validation error cases throw Problem.user.entityViolation (409.14), which is a conflict problem rather than a bad request problem. This problem was made back when we started parsing submission XML to create entities and foresaw entity conflict as one possible problem.

I think we could go back and update pure validation errors to throw the 400.28 error instead of 409.14. The names could also be better - entityConflict and invalidEntity or something.

@ktuite ktuite added the entities Multiple Encounter workflows label May 3, 2023
@matthew-white
Copy link
Member

I also think we should try to use more specific Problems that already exist when those are appropriate. For example, Problems like Problem.missingParameter() or Problem.invalidDataTypeOfParameter() that have well-defined detail properties. I think it's nice to have Problem.invalidEntity() as a fallback, but I feel like our first choice should be to reach for something more specific.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
entities Multiple Encounter workflows
Projects
Status: ✅ done
Development

Successfully merging a pull request may close this issue.

3 participants