X Tutup
Skip to content

feat: add asdict() and to_json() methods to Gitlab Objects#1872

Merged
nejch merged 2 commits intomainfrom
jlvillal/as_dict
Jul 20, 2022
Merged

feat: add asdict() and to_json() methods to Gitlab Objects#1872
nejch merged 2 commits intomainfrom
jlvillal/as_dict

Conversation

@JohnVillalovos
Copy link
Member

@JohnVillalovos JohnVillalovos commented Feb 2, 2022

Add an asdict() method that returns a dictionary representation copy
of the Gitlab Object. This is a copy and changes made to it will have
no impact on the Gitlab Object.

The asdict() method name was chosen as both the dataclasses and
attrs libraries have an asdict() function which has the similar
purpose of creating a dictionary represenation of an object.

Also add a to_json() method that returns a JSON string
representation of the object.

Closes: #1116

Loading
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

Successfully merging this pull request may close these issues.

ProjectLabel objects are not JSON serializable

4 participants

X Tutup