blaugold / unsplash_client

An unofficial, platform independent, client for the Unsplash API. Unsplash provides royalty-free images.
https://pub.dev/packages/unsplash_client
BSD 3-Clause "New" or "Revised" License
24 stars 7 forks source link

Store JSON source with models #10

Closed blaugold closed 3 years ago

blaugold commented 3 years ago

The models only expose fields which are documented in the API docs, but users of the library might want to access undocumented fields.

To support this, models should have a source property which stores the JSON data which was used to create them. This property is nullable because a model is not always built from an API response, for example when updating a resource. Equality and hash code should not take this property into account, to avoid breaking existing code.