Skip to content
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

ValueError: Unknown object to dump: float #92

Closed
torwald-sergesson opened this issue Oct 17, 2016 · 1 comment
Closed

ValueError: Unknown object to dump: float #92

torwald-sergesson opened this issue Oct 17, 2016 · 1 comment
Milestone

Comments

@torwald-sergesson
Copy link
Contributor

I have this code in my swagger file in definitions section:

definitions:
  Location:
    title: Location
    description: 'Location coordinates'
    type: object
    properties:
      lon:
        type: number
        description: Longitude
        example: 86.12
      lat:
        type: number
        description: Latitude
        example: 56.123
    required:
      - lon
      - lat

When I try to dump it, I got this ValueError.

>>>app = App._create_('swagger.yaml')
>>> app.root.dump()
Traceback (most recent call last):
  File "/home/torwald/.venv/anyevent__backend/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 2885, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-1-99ddff4bc766>", line 1, in <module>
    self.app.root.dump()
  File "/home/torwald/.venv/anyevent__backend/lib/python3.5/site-packages/pyswagger/spec/base.py", line 420, in dump
    d = _dump_(v)
  File "/home/torwald/.venv/anyevent__backend/lib/python3.5/site-packages/pyswagger/spec/base.py", line 402, in _dump_
    ret[k] = _dump_(v)
  File "/home/torwald/.venv/anyevent__backend/lib/python3.5/site-packages/pyswagger/spec/base.py", line 410, in _dump_
    return obj.dump()
  File "/home/torwald/.venv/anyevent__backend/lib/python3.5/site-packages/pyswagger/spec/base.py", line 420, in dump
    d = _dump_(v)
  File "/home/torwald/.venv/anyevent__backend/lib/python3.5/site-packages/pyswagger/spec/base.py", line 402, in _dump_
    ret[k] = _dump_(v)
  File "/home/torwald/.venv/anyevent__backend/lib/python3.5/site-packages/pyswagger/spec/base.py", line 410, in _dump_
    return obj.dump()
  File "/home/torwald/.venv/anyevent__backend/lib/python3.5/site-packages/pyswagger/spec/base.py", line 420, in dump
    d = _dump_(v)
  File "/home/torwald/.venv/anyevent__backend/lib/python3.5/site-packages/pyswagger/spec/base.py", line 414, in _dump_
    raise ValueError('Unknown object to dump: {0}'.format(obj.__class__.__name__))
ValueError: Unknown object to dump: float
@mission-liao mission-liao added this to the v0.8.25 milestone Oct 20, 2016
mission-liao added a commit that referenced this issue Jan 9, 2017
mission-liao added a commit that referenced this issue Jan 9, 2017
- #103
- #92
- #100 support python
3.6
- #92
@mission-liao
Copy link
Member

the fix is included in v0.8.25, thanks for contributing and feel free to reopen it when not work.

mission-liao added a commit to pyopenapi/pyopenapi that referenced this issue Aug 12, 2017
mission-liao added a commit to pyopenapi/pyopenapi that referenced this issue Aug 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants