-
Notifications
You must be signed in to change notification settings - Fork 18
feat: add schema to event parameters #233
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
Conversation
1bc1591
to
d077fab
Compare
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.
This change looks good to me.
Though in my testing, I've been unable to get a return_value
from an http_server_response
event using Flask 1.1.2. I'm not really sure what the deal is there. I'm not getting any exceptions so I'm inclined to say it's unrelated to this change. Here's the app if you're interested: https://gist.github.com/dustinbyrne/ef0f8094c55d5724ae6f40edbd4a3927
schema_key = "properties" | ||
|
||
schema = [_describe_schema(k, v, depth + 1, max_depth) for k, v in elts] | ||
# schema will be [None] if depth is exceeded, don't use it |
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.
This looks to be the only difference between this implementation and Ruby. In short, an array must always provide a type so in Ruby we'll go beyond the max depth to obtain the typing information for an array. However, we've since added a default which will pass OpenAPI validation in the absence of an array type.
This should work just fine.
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.
I believe I ported over all the tests from appmap-ruby
. Maybe one showing this behavior is missing?
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.
I added a test to check this: getappmap/appmap-ruby#321 .
I'll take a quick look at the Flask issue. Flask 1 got EOLed with the release of Flask 2 on 2021-05-11, though, so I'm not sure how much effort we should devote to supporting it. |
Add "properties" and "items" schemas to "parameters" objects , as specified in v1.11.0 of the appmap spec.
9977bb5
to
838f2de
Compare
EOL two years ago? None :-) |
Add "properties" and "items" schemas to "parameters" objects , as specified in v1.11.0 of the appmap spec.
Fixes #226 .