Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] The tags in OpenAPI yaml are not effective #246

Open
AllenCHM opened this issue May 22, 2024 · 0 comments
Open

[Bug] The tags in OpenAPI yaml are not effective #246

AllenCHM opened this issue May 22, 2024 · 0 comments

Comments

@AllenCHM
Copy link

AllenCHM commented May 22, 2024

@xcx_login_route.post("/login")
@json_validate(WechatLoginRequest)
async def wechat_login(
    request: Request, parsed_data:dict, *args, **kwargs
) -> HTTPResponse:
    """微信小程序登录

    code  小程序wx.login()获取

    openapi:
    ---
    tags: 
        - 微信小程序

After testing, the tag is not effective。

After debugging testing, operation_ The tags in Autodoc are not effective.
Solution: Need to adjust code sanic_ext/extensions/openapis/builders. py (line 153)

The adjusted code is

    def autodoc(self, docstring: str):
        y = YamlStyleParametersParser(docstring)
        self._autodoc = y.to_openAPI_3()
        if self._autodoc.get('tags'):
            self.tags = self._autodoc['tags']
@AllenCHM AllenCHM changed the title The tags in OpenAPI yaml are not effective [Bug] [Bug] The tags in OpenAPI yaml are not effective May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant