1
0
mirror of https://github.com/checktheroads/hyperglass synced 2024-05-11 05:55:08 +00:00

fix model type annotations to make flake8 happy

This commit is contained in:
checktheroads
2020-07-13 02:18:26 -07:00
parent 10593de581
commit 8b02787aea
9 changed files with 43 additions and 20 deletions

View File

@@ -5,6 +5,8 @@ from pydantic import Field, HttpUrl, StrictStr, StrictBool, constr
# Project
from hyperglass.models import AnyUri, HyperglassModel
DocsMode = constr(regex=r"(swagger|redoc)")
class EndpointConfig(HyperglassModel):
"""Validation model for per API endpoint documentation."""
@@ -32,7 +34,7 @@ class Docs(HyperglassModel):
enable: StrictBool = Field(
True, title="Enable", description="Enable or disable API documentation."
)
mode: constr(regex=r"(swagger|redoc)") = Field(
mode: DocsMode = Field(
"redoc",
title="Docs Mode",
description="OpenAPI UI library to use for the hyperglass API docs. Currently, the options are [Swagger UI](/fixme) and [Redoc](/fixme).",