softvar / simplegist

Advanced python wrapper for Github Gist API
https://pypi.python.org/pypi/simplegist
MIT License
64 stars 24 forks source link

Creating a gist is broken #10

Open samuela opened 4 years ago

samuela commented 4 years ago
In [4]: sg.create(name='testing123', content='hello world')
---------------------------------------------------------------------------
Exception                                 Traceback (most recent call last)
<ipython-input-4-98fc4080448e> in <module>
----> 1 sg.create(name='testing123', content='hello world')

~/dev/simplegist/simplegist/__init__.py in create(self, **args)
    112             }
    113                         return response
--> 114                 raise Exception('Gist not created: server response was [%s] %s' % (r.status_code, r.text))

Exception: Gist not created: server response was [422] {"message":"Invalid request.\n\nNo subschema in \"anyOf\" matched.\nFor 'anyOf/0', 1 is not a boolean.\n1 is not a member of [\"true\", \"false\"].\nFor 'anyOf/1', 1 is not a string.\nFor 'anyOf/2', 1 is not a null.","documentation_url":"https://developer.github.com/v3/gists/#create-a-gist"}
samuela commented 4 years ago

Solution is to do sg.create(name='testing123', content='hello world', public="true") which doesn't make much sense