-
Notifications
You must be signed in to change notification settings - Fork 106
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
[Events] Failed to generate an user event #10
Comments
You're correct. Right now, swagger-py does not support body parameters - as such, it doesn't have support for a dictionary of values that should be converted to JSON. |
And, this is a problem in swagger-py, not ari-py (it just happens to break ari-py as well). |
Is swagger-py expected to support body params? |
No one is "responsible". It's an open source project, currently under the Digium repo (since that's what we had available at the time). https://github.com/digium/swagger-py Anyone can make a pull request to it. |
Note that if you really need this functionality, you can still simply make posts manually. For example: import json
import requests
data = json.dumps({'variables': {'myvar': 'myval'}})
headers = {'Content-type': 'application/json', 'Accept': 'application/json'}
auth = ('username', 'password')
params = {'eventName': 'myevent', 'application': 'myappname'}
requests.post('http://127.0.0.1:8088/ari/events/user/myevent',data=data, headers=headers, auth=auth, params=params) I'd prefer to use ari-py everywhere though, so hopefully this functionality will be added in the next release! See digium/swagger-py#9. |
Hello folks,
When I generate an user event I receive the following error:
"AttributeError: 'dict' object has no attribute 'paramType'" , raised on swaggerpy/client.py line 73. (more details here [1]).
I believe that this is a swagger-py limitation since the parameter type is expected to be 'path' or 'query' and when you generate an user event the type of 'variables' parameter will be 'body' .
Below you can find the code which generates the error:
[1]
All the best,
Claudiu
The text was updated successfully, but these errors were encountered: