From 20abd74de82edbc486caffd5e97418dae2b4cb28 Mon Sep 17 00:00:00 2001 From: checktheroads Date: Mon, 20 Jan 2020 10:19:27 -0700 Subject: [PATCH] add fastapi docs config model --- hyperglass/configuration/models/docs.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 hyperglass/configuration/models/docs.py diff --git a/hyperglass/configuration/models/docs.py b/hyperglass/configuration/models/docs.py new file mode 100644 index 0000000..208ed4f --- /dev/null +++ b/hyperglass/configuration/models/docs.py @@ -0,0 +1,15 @@ +# Third Party Imports +from pydantic import StrictBool +from pydantic import constr + +# Project Imports +from hyperglass.configuration.models._utils import AnyUri +from hyperglass.configuration.models._utils import HyperglassModel + + +class Docs(HyperglassModel): + """Validation model for params.general.docs.""" + + enable: StrictBool = True + mode: constr(regex=r"(swagger|redoc)") = "swagger" + uri: AnyUri = "/docs"