docs: Add some notes about validation that are performed

This commit is contained in:
Thomas Adamcik 2015-07-22 19:31:02 +02:00
parent d74e40f5e8
commit edd7afb174
3 changed files with 10 additions and 1 deletions

View File

@ -13,6 +13,12 @@ frontends and the backends. Don't forget that you will be accessing core
as a Pykka actor. If you are only interested in being notified about changes
in core see :class:`~mopidy.core.CoreListener`.
.. versionchanged:: 1.1
All core API calls are now type checked.
.. versionchanged:: 1.1
All backend return values are now type checked.
.. autoclass:: mopidy.core.Core
.. attribute:: tracklist

View File

@ -5,7 +5,7 @@
These immutable data models are used for all data transfer within the Mopidy
backends and between the backends and the MPD frontend. All fields are optional
and immutable. In other words, they can only be set through the class
constructor during instance creation.
constructor during instance creation. Additionally fields are type checked.
If you want to modify a model, use the
:meth:`~mopidy.models.ImmutableObject.replace` method. It accepts keyword

View File

@ -437,6 +437,9 @@ When writing an extension, you should only use APIs documented at
:ref:`api-ref`. Other parts of Mopidy, like :mod:`mopidy.internal`, may change
at any time and are not something extensions should use.
Mopidy performs type checking to help catch extension bugs. This applies to
both to frontend calls into core and return values from backends. Additionally
model fields always get validated to further guard against bad data.
Logging in extensions
=====================