This finally adds the API documentation for plugin.api.validate. An API guide with real-life examples is not included yet and will be added later.
This was much more work than expected. Especially because of several sphinx-autodoc issues which required me to reformat and move everything multiple times.
I've tried to make the style as consistent as possible, but there are some inconsistencies between the validate docs, schema docs and utility function docs. These are just minor differences though and you won't notice them. I won't even tell you.
As explained in the top comment of validate.rst, the layout was chosen deliberately because of certain autodoc quirks. Unfortunately, it's not ideal, but it's the best I could come up with.
My first attempt was documenting all overloading function of validate() (base schema types, as well as custom schemas), but then I noticed that autodoc doesn't support singledispatch properly.
Manually importing the functions using autofunction also was a bad idea, because this would require duplicate docs, on both the schema validation functions and the schema classes themselves.
So I ended up with the current appoach of adding custom function docs in the validate.rst file for the basic schema validation functions like type, abc.Callable, list (etc), dict and re.Pattern, and importing the rest with proper docstrings in the python modules.