pyopenapi / pyswagger

An OpenAPI (fka Swagger) client & converter in python, which is type-safe, dynamic, spec-compliant.
MIT License
384 stars 88 forks source link

Fix NameError when unsupported UUID type is passed to primitive factory #124

Closed olipratt closed 7 years ago

olipratt commented 7 years ago

Hi,

This is just a small bug, so I've not raised an issue for it - hope that's ok. This change fixes the error shown in the stack trace below so that the correct exception is raised.

Fix is just to use the correct variable name, and I added a test to verify the fix.

  File "C:\Program Files (x86)\Python 3.5\lib\site-packages\pyswagger\primitives\comm.py", line 40, in _2nd_pass_obj
    return ret.apply_with(obj, val, ctx)
  File "C:\Program Files (x86)\Python 3.5\lib\site-packages\pyswagger\primitives\_uuid.py", line 33, in apply_with
    raise ValueError('Unrecognized type for UUID: ' + str(type(v)))
NameError: name 'v' is not defined
coveralls commented 7 years ago

Coverage Status

Changes Unknown when pulling 4a3c523a1d0035630197609600a0d8e940fe184e on olipratt:uuiderror into on mission-liao:master.

mission-liao commented 7 years ago

Thanks for this PR, :). I'll find some time to compose another build for it.

IMO, there is no problem for not composing a github issue, since we can query both PR and issue in the search box. And thanks again for providing test case for PR.

olipratt commented 7 years ago

Great - thanks. No hurry for a new build from me - this was just something I hit by accident and isn't causing me any problems now.