Open claudiuolteanu opened 10 years ago
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? Who is responsible for developing it? Thanks.
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