{"action":"created","issue":{"url":"https://api.github.com/repos/mission-liao/pyswagger/issues/127","repository_url":"https://api.github.com/repos/mission-liao/pyswagger","labels_url":"https://api.github.com/repos/mission-liao/pyswagger/issues/127/labels{/name}","comments_url":"https://api.github.com/repos/mission-liao/pyswagger/issues/127/comments","events_url":"https://api.github.com/repos/mission-liao/pyswagger/issues/127/events","html_url":"https://github.com/mission-liao/pyswagger/issues/127","id":239950621,"number":127,"title":"ValueError: Can't resolve type from:(number, int32)","user":{"login":"Kyria","id":1838373,"avatar_url":"https://avatars1.githubusercontent.com/u/1838373?v=3","gravatar_id":"","url":"https://api.github.com/users/Kyria","html_url":"https://github.com/Kyria","followers_url":"https://api.github.com/users/Kyria/followers","following_url":"https://api.github.com/users/Kyria/following{/other_user}","gists_url":"https://api.github.com/users/Kyria/gists{/gist_id}","starred_url":"https://api.github.com/users/Kyria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kyria/subscriptions","organizations_url":"https://api.github.com/users/Kyria/orgs","repos_url":"https://api.github.com/users/Kyria/repos","events_url":"https://api.github.com/users/Kyria/events{/privacy}","received_events_url":"https://api.github.com/users/Kyria/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-07-01T13:53:33Z","updated_at":"2017-07-01T23:32:46Z","closed_at":null,"body":"```\r\n>>> from pyswagger import App\r\n>>> app = App.create('https://esi.tech.ccp.is/latest/swagger.json?datasource=tranquility')\r\n>>> app.op['get_markets_region_id_orders']( region_id=1002, type_id=34, order_type='all')\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n  File \"/home/Kyria/dev/LazyBlacksmith/env/local/lib/python2.7/site-packages/pyswagger/spec/v2_0/objects.py\", line 283, in __call__\r\n    _convert_parameter(final(p))\r\n  File \"/home/Kyria/dev/LazyBlacksmith/env/local/lib/python2.7/site-packages/pyswagger/spec/v2_0/objects.py\", line 264, in _convert_parameter\r\n    c = p._prim_(v, self._prim_factory, ctx=dict(read=False))\r\n  File \"/home/Kyria/dev/LazyBlacksmith/env/local/lib/python2.7/site-packages/pyswagger/spec/v2_0/objects.py\", line 184, in _prim_\r\n    return prim_factory.produce(self.schema, v, ctx) if i == 'body' else prim_factory.produce(self, v, ctx)\r\n  File \"/home/Kyria/dev/LazyBlacksmith/env/local/lib/python2.7/site-packages/pyswagger/primitives/__init__.py\", line 178, in produce\r\n    raise ValueError('Can\\'t resolve type from:(' + str(obj.type) + ', ' + str(obj.format) + ')')\r\nValueError: Can't resolve type from:(number, int32)\r\n\r\n>>> app.op['get_markets_structures_structure_id'](structure_id=12345)\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n  File \"/home/Kyria/dev/LazyBlacksmith/env/local/lib/python2.7/site-packages/pyswagger/spec/v2_0/objects.py\", line 283, in __call__\r\n    _convert_parameter(final(p))\r\n  File \"/home/Kyria/dev/LazyBlacksmith/env/local/lib/python2.7/site-packages/pyswagger/spec/v2_0/objects.py\", line 264, in _convert_parameter\r\n    c = p._prim_(v, self._prim_factory, ctx=dict(read=False))\r\n  File \"/home/Kyria/dev/LazyBlacksmith/env/local/lib/python2.7/site-packages/pyswagger/spec/v2_0/objects.py\", line 184, in _prim_\r\n    return prim_factory.produce(self.schema, v, ctx) if i == 'body' else prim_factory.produce(self, v, ctx)\r\n  File \"/home/Kyria/dev/LazyBlacksmith/env/local/lib/python2.7/site-packages/pyswagger/primitives/__init__.py\", line 178, in produce\r\n    raise ValueError('Can\\'t resolve type from:(' + str(obj.type) + ', ' + str(obj.format) + ')')\r\nValueError: Can't resolve type from:(number, int32)\r\n```\r\n\r\n**Link the the swagger.json used:** https://esi.tech.ccp.is/latest/swagger.json?datasource=tranquility \r\n\r\nIt looks like every endpoints that have this issue use a referenced parameters which is a \"number\" / \"int32\" format.\r\n\r\n```\r\n    \"page\": {\r\n      \"default\": 1,\r\n      \"description\": \"Which page of results to return\",\r\n      \"format\": \"int32\",\r\n      \"in\": \"query\",\r\n      \"name\": \"page\",\r\n      \"type\": \"number\"\r\n    },\r\n```\r\n\r\nIf I understand correctly types defined in the JSON-Schema Draft 4. Models, used by swagger, \r\n```\r\n   integer  A JSON number without a fraction or exponent part.\r\n   number  Any JSON number.  Number includes integer.\r\n```\r\nnumber also contains integer by definition, so `integer/int32` should work (which is not the case currently). \r\n(also swagger validator do not report any issues with `number/int32` and `number/int64`. )\r\n\r\nCan you correct this ?\r\n\r\nThanks in advance !\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/mission-liao/pyswagger/issues/comments/312461171","html_url":"https://github.com/mission-liao/pyswagger/issues/127#issuecomment-312461171","issue_url":"https://api.github.com/repos/mission-liao/pyswagger/issues/127","id":312461171,"user":{"login":"mission-liao","id":1988671,"avatar_url":"https://avatars1.githubusercontent.com/u/1988671?v=3","gravatar_id":"","url":"https://api.github.com/users/mission-liao","html_url":"https://github.com/mission-liao","followers_url":"https://api.github.com/users/mission-liao/followers","following_url":"https://api.github.com/users/mission-liao/following{/other_user}","gists_url":"https://api.github.com/users/mission-liao/gists{/gist_id}","starred_url":"https://api.github.com/users/mission-liao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mission-liao/subscriptions","organizations_url":"https://api.github.com/users/mission-liao/orgs","repos_url":"https://api.github.com/users/mission-liao/repos","events_url":"https://api.github.com/users/mission-liao/events{/privacy}","received_events_url":"https://api.github.com/users/mission-liao/received_events","type":"User","site_admin":false},"created_at":"2017-07-01T23:32:46Z","updated_at":"2017-07-01T23:32:46Z","body":"You can extend the supported primitives by following this [tutorial](https://github.com/mission-liao/pyswagger/blob/master/docs/md/tutorial/extend_prim.md). If it doesn't work or not fit your needs, please feel free to let me know."}}
{"actor":{"display_login":"mission-liao"}}