You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I meet a problem. When I use pyswagger generate a client to call api, I first do Authenticate which is the api my project provide, and then call an api whose OperationId is "discoverImageList".
The first authenticate call is correct, but the second call occur error, I don't know why.
Traceback (most recent call last):
File "/scratch/shuluo/swagger/swagger_sdk/compute-controlplane/devscripts/swaggerclient/new 2.py", line 16, in
aa = client.request(app.op"discoverImageList")
File "/scratch/shuluo/swagger/swagger_sdk/pyclient/compute-controlplane/virtualenv/lib/python2.6/site-packages/pyswagger/contrib/client/requests.py", line 55, in request
raw=six.StringIO(rs.content).getvalue()
File "/scratch/shuluo/swagger/swagger_sdk/pyclient/compute-controlplane/virtualenv/lib/python2.6/site-packages/pyswagger/io.py", line 361, in apply_with
self.data = r.schema.prim(data, self.__op._prim_factory)
File "/scratch/shuluo/swagger/swagger_sdk/pyclient/compute-controlplane/virtualenv/lib/python2.6/site-packages/pyswagger/spec/v2_0/objects.py", line 92, in prim
return prim_factory.produce(self, v)
File "/scratch/shuluo/swagger/swagger_sdk/pyclient/compute-controlplane/virtualenv/lib/python2.6/site-packages/pyswagger/primitives/__init.py", line 184, in produce
val = ret.apply_with(obj, val, ctx)
File "/scratch/shuluo/swagger/swagger_sdk/pyclient/compute-controlplane/virtualenv/lib/python2.6/site-packages/pyswagger/primitives/_model.py", line 26, in apply_with
self[k] = ctx['factory'].produce(pobj, v)
File "/scratch/shuluo/swagger/swagger_sdk/pyclient/compute-controlplane/virtualenv/lib/python2.6/site-packages/pyswagger/primitives/init.py", line 180, in produce
val = _2nd(obj, ret, val, ctx)
File "/scratch/shuluo/swagger/swagger_sdk/pyclient/compute-controlplane/virtualenv/lib/python2.6/site-packages/pyswagger/primitives/comm.py", line 40, in _2nd_pass_obj
return ret.apply_with(obj, val, ctx)
File "/scratch/shuluo/swagger/swagger_sdk/pyclient/compute-controlplane/virtualenv/lib/python2.6/site-packages/pyswagger/primitives/_array.py", line 37, in apply_with
self.extend(map(functools.partial(ctx['factory'].produce, obj.items), val))
File "/scratch/shuluo/swagger/swagger_sdk/pyclient/compute-controlplane/virtualenv/lib/python2.6/site-packages/pyswagger/primitives/init.py", line 184, in produce
val = ret.apply_with(obj, val, ctx)
File "/scratch/shuluo/swagger/swagger_sdk/pyclient/compute-controlplane/virtualenv/lib/python2.6/site-packages/pyswagger/primitives/_model.py", line 26, in apply_with
self[k] = ctx['factory'].produce(pobj, v)
File "/scratch/shuluo/swagger/swagger_sdk/pyclient/compute-controlplane/virtualenv/lib/python2.6/site-packages/pyswagger/primitives/init.py", line 176, in produce
raise ValueError('Can't resolve type from:(' + str(obj.type) + ', ' + str(obj.format) + ')')
ValueError: Can't resolve type from:(integer, None)
The text was updated successfully, but these errors were encountered:
Hi, this issue might be duplicated with #65
Could you try the solution I provided in that issue first? If it doesn't work, please feel free to let me know, and a reproducible code/schema would be helpful.
This issue won't be fixed because (integer, None) is actually not defined in Swagger Spec. They prefer explicit definition and only (integer, int32) or (integer, int64) is acceptable. For things not defined in spec, you would need to workaround by the solution I provided in that issue.
Hi,
I meet a problem. When I use pyswagger generate a client to call api, I first do Authenticate which is the api my project provide, and then call an api whose OperationId is "discoverImageList".
The first authenticate call is correct, but the second call occur error, I don't know why.
Traceback (most recent call last):
File "/scratch/shuluo/swagger/swagger_sdk/compute-controlplane/devscripts/swaggerclient/new 2.py", line 16, in
aa = client.request(app.op"discoverImageList")
File "/scratch/shuluo/swagger/swagger_sdk/pyclient/compute-controlplane/virtualenv/lib/python2.6/site-packages/pyswagger/contrib/client/requests.py", line 55, in request
raw=six.StringIO(rs.content).getvalue()
File "/scratch/shuluo/swagger/swagger_sdk/pyclient/compute-controlplane/virtualenv/lib/python2.6/site-packages/pyswagger/io.py", line 361, in apply_with
self.data = r.schema.prim(data, self.__op._prim_factory)
File "/scratch/shuluo/swagger/swagger_sdk/pyclient/compute-controlplane/virtualenv/lib/python2.6/site-packages/pyswagger/spec/v2_0/objects.py", line 92, in prim
return prim_factory.produce(self, v)
File "/scratch/shuluo/swagger/swagger_sdk/pyclient/compute-controlplane/virtualenv/lib/python2.6/site-packages/pyswagger/primitives/__init.py", line 184, in produce
val = ret.apply_with(obj, val, ctx)
File "/scratch/shuluo/swagger/swagger_sdk/pyclient/compute-controlplane/virtualenv/lib/python2.6/site-packages/pyswagger/primitives/_model.py", line 26, in apply_with
self[k] = ctx['factory'].produce(pobj, v)
File "/scratch/shuluo/swagger/swagger_sdk/pyclient/compute-controlplane/virtualenv/lib/python2.6/site-packages/pyswagger/primitives/init.py", line 180, in produce
val = _2nd(obj, ret, val, ctx)
File "/scratch/shuluo/swagger/swagger_sdk/pyclient/compute-controlplane/virtualenv/lib/python2.6/site-packages/pyswagger/primitives/comm.py", line 40, in _2nd_pass_obj
return ret.apply_with(obj, val, ctx)
File "/scratch/shuluo/swagger/swagger_sdk/pyclient/compute-controlplane/virtualenv/lib/python2.6/site-packages/pyswagger/primitives/_array.py", line 37, in apply_with
self.extend(map(functools.partial(ctx['factory'].produce, obj.items), val))
File "/scratch/shuluo/swagger/swagger_sdk/pyclient/compute-controlplane/virtualenv/lib/python2.6/site-packages/pyswagger/primitives/init.py", line 184, in produce
val = ret.apply_with(obj, val, ctx)
File "/scratch/shuluo/swagger/swagger_sdk/pyclient/compute-controlplane/virtualenv/lib/python2.6/site-packages/pyswagger/primitives/_model.py", line 26, in apply_with
self[k] = ctx['factory'].produce(pobj, v)
File "/scratch/shuluo/swagger/swagger_sdk/pyclient/compute-controlplane/virtualenv/lib/python2.6/site-packages/pyswagger/primitives/init.py", line 176, in produce
raise ValueError('Can't resolve type from:(' + str(obj.type) + ', ' + str(obj.format) + ')')
ValueError: Can't resolve type from:(integer, None)
The text was updated successfully, but these errors were encountered: