diff --git a/doc/source/dev/plugin/action-plugin.rst b/doc/source/dev/plugin/action-plugin.rst index c1816994c..6c6718552 100644 --- a/doc/source/dev/plugin/action-plugin.rst +++ b/doc/source/dev/plugin/action-plugin.rst @@ -50,6 +50,8 @@ Here is an example showing how you can write a plugin called ``DummyAction``: # Filepath = /thirdparty/dummy.py # Import path = thirdparty.dummy + import voluptuous + from watcher.applier.actions import base @@ -57,7 +59,7 @@ Here is an example showing how you can write a plugin called ``DummyAction``: @property def schema(self): - return Schema({}) + return voluptuous.Schema({}) def execute(self): # Does nothing @@ -83,6 +85,16 @@ To get a better understanding on how to implement a more advanced action, have a look at the :py:class:`~watcher.applier.actions.migration.Migrate` class. +Input validation +---------------- + +As you can see in the previous example, we are using `Voluptuous`_ to validate +the input parameters of an action. So if you want to learn more about how to +work with `Voluptuous`_, you can have a look at their `documentation`_ here: + +.. _Voluptuous: https://github.com/alecthomas/voluptuous +.. _documentation: https://github.com/alecthomas/voluptuous/blob/master/README.md + Abstract Plugin Class =====================