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

Validate mongo documents on the server #8

Open
mycrobe opened this issue Feb 24, 2016 · 1 comment
Open

Validate mongo documents on the server #8

mycrobe opened this issue Feb 24, 2016 · 1 comment

Comments

@mycrobe
Copy link
Contributor

mycrobe commented Feb 24, 2016

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.)
@mycrobe
Copy link
Contributor Author

mycrobe commented Mar 2, 2016

This is explicitly not supported automatically by swagger-express-mw version 0.6.0. It might be possible to write this ourselves.

@mycrobe mycrobe added this to the Release 51 milestone Mar 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant