-
Notifications
You must be signed in to change notification settings - Fork 28
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
Issue #91: Add improved event validator API #94
Conversation
For reviewers, I'm more interested in feedback on use of the new API than a code review. That said, I do think the swagger doc should show the response format. |
A few observations from a quick test
Probably not directly related to the validator itself, but I don't think
I don't see a need to validate contents of the
|
I noticed the
The |
For whatever it's worth, I hard-coded support for I am also not sure that allowing that generically for any object is wise; if anything, it might make more sense to make that a property of the attribute (i.e., |
Explicitly handling I think handling
That is a terse way to say it. When documented, examples would be used to clarify the concept. In the core schema, the (BTW: I actually don't know why This isn't the only path forward, though. Here are the alternatives I see:
IMHO, the existing use of @dkolbly, @pagbabian-splunk, and others, thoughts? |
…dation of observables. Add (limited) observable validation.
…vent bundle with /api/v2/validate_bundle. Remove try/rescue pattern from schema_controller.ex as it returns exception message, leaking internal implementation details (a security problem). Improve Swagger docs for new APIs.
Last commit moves validation of from That should be the last change, barring further issues found or a change related to how |
Excellent analysis of variant approaches @rmouritzen-splunk ! I didn't even think of your number 3, Especially when considered in the context of That helps steer people away from the open-ended objects as much as possible, makes it more obvious when they are using them, and makes things cleaner (I think) from an encoding perspective (certainly it does for protobuf encoding). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To the extent I can read elixir code, looks good to me!
This addresses issue #91.
This API is at
POST /api/v2/validate
. It is separate from the existingPOST /api/validate
as the response has a different structure.This v2 event validator checks all existing aspects of the input event based on the schema.
The input is the same as it was: either a single event JSON object, or a list of events as a JSON array of objects. The response will either be a JSON object or JSON array of objects. The content of the response objects is shown here: