devopshq / teamcity

dohq-teamcity is a Python package providing access to the JetBrains TeamCity server API.
https://devopshq.github.io/teamcity/
MIT License
33 stars 12 forks source link

json output #16

Closed sdemura closed 5 years ago

sdemura commented 5 years ago

objects should be able to be serialized into JSON for easier parsing/automation.

allburov commented 5 years ago

@sdemura objects can dump as python-primitives, use to_dict method for this:

data = obj.to_dict()
# convert to JSON if needed
json.dumps(data)

I added this example to documentation, thanks!

allburov commented 5 years ago

https://devopshq.github.io/teamcity/api-usage.html#save-as-dict