API Data Validation

Description

Figure out how to validate user input (Hibernate Validator?). How errors are reported by the API to the caller?

Examples include uniqueness, required fields, value ranges, etc.

  • See if Spring has a preference for domain object validation

  • otherwise implement basic validation for one of the existing objects, say using the Validator pattern. Should employ good OO design.

  • In the case of a validation error, caller should get message

  • document the practice on the Wiki, Developer guide section.

blocks

QAlity Plus - Test Management

Checklists

Activity

Show:
Ben Leibert
June 7, 2016 at 6:15 PM

Addressed by commit 46ca1ed within the “openlmis-example” repository. I chose this repo because our existing (reference) data is immutable, isn’t exposed by modification-related endpoints, and is therefore not a good candidate through which to test and demonstrate data validation.

Although error-reporting and data-validation tend to go hand-in-hand, the former is being addressed by another spike (https://openlmis.atlassian.net/browse/OLMIS-590#icft=OLMIS-590). I thus considered it beyond the purview of this one.

Once the pull-request(s) related to this story are merged, I’ll consider its approach acceptable to the team and proceed to document it in our wiki.

Done
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Story Points

Sprint

None

Fix versions

Priority

Time Assistant

Created May 19, 2016 at 10:06 AM
Updated November 12, 2016 at 11:32 AM
Resolved June 10, 2016 at 6:52 PM