-
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #123 from 0b01001001/dev
support tag description and external doc url
- Loading branch information
Showing
14 changed files
with
95 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
|
||
setup( | ||
name="spectree", | ||
version="0.4.2", | ||
version="0.4.3", | ||
author="Keming Yang", | ||
author_email="[email protected]", | ||
description=( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
import logging | ||
|
||
from .models import Tag | ||
from .response import Response | ||
from .spec import SpecTree | ||
|
||
__all__ = ["SpecTree", "Response"] | ||
__all__ = ["SpecTree", "Response", "Tag"] | ||
|
||
# setup library logging | ||
logging.getLogger(__name__).addHandler(logging.NullHandler()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
from typing import Any, Dict, Sequence | ||
|
||
from pydantic import BaseModel, Field | ||
|
||
|
||
class ExternalDocs(BaseModel): | ||
description: str = "" | ||
url: str | ||
|
||
|
||
class Tag(BaseModel): | ||
"""OpenAPI tag object""" | ||
|
||
name: str | ||
description: str = "" | ||
externalDocs: ExternalDocs = None | ||
|
||
def __str__(self): | ||
return self.name | ||
|
||
|
||
class UnprocessableEntityElement(BaseModel): | ||
"""Model of missing field description.""" | ||
|
||
loc: Sequence[str] = Field( | ||
..., | ||
title="Missing field name", | ||
) | ||
msg: str = Field( | ||
..., | ||
title="Error message", | ||
) | ||
type: str = Field( # noqa: WPS125 | ||
..., | ||
title="Error type", | ||
) | ||
ctx: Dict[str, Any] = Field( | ||
None, | ||
title="Error context", | ||
) | ||
|
||
|
||
class UnprocessableEntity(BaseModel): | ||
"""Model of 422 Unprocessable Entity error.""" | ||
|
||
__root__: Sequence[UnprocessableEntityElement] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,6 @@ def demo_func_with_query(): | |
a description | ||
""" | ||
pass | ||
|
||
|
||
class DemoClass: | ||
|