SOLR docs are never deserialized and thus can't be validated. However, the mongo client gives us mongo documents as Javascript objects, which are definitely validate-able.
What is the most appropriate way to handle validation, given that the REST service returns a simple array of documents?
- Refactor response to an object with, e.g.
docs and metadata subdocuments (with docs containing the array currently returned, and metadata including the validation information)?
- Modify each document to add
validation field? (This is probably not a good idea.)
SOLR docs are never deserialized and thus can't be validated. However, the mongo client gives us mongo documents as Javascript objects, which are definitely validate-able.
What is the most appropriate way to handle validation, given that the REST service returns a simple array of documents?
docsandmetadatasubdocuments (withdocscontaining the array currently returned, andmetadataincluding the validation information)?validationfield? (This is probably not a good idea.)