-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add support to OpenAPI script for applying schema to methods #3374
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
base: main
Are you sure you want to change the base?
Conversation
| def method_parameter( | ||
| name: str, *, required: bool = False, merge: list[str] | None = None, docstring_prepend: str | None = None | ||
| ): | ||
| def openapi_property_decorator(fn): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| def openapi_property_decorator(fn): | |
| def openapi_method_decorator(fn): |
| def openapi_property_decorator(fn): | ||
| return fn | ||
|
|
||
| return openapi_property_decorator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| return openapi_property_decorator | |
| return openapi_method_decorator |
| def openapi_property_decorator(fn): | ||
| return fn | ||
|
|
||
| return openapi_property_decorator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| def openapi_property_decorator(fn): | |
| return fn | |
| return openapi_property_decorator | |
| def openapi_method_decorator(fn): | |
| return fn | |
| return openapi_method_decorator |
| for k, v in [ | ||
| ("name", cst_to_python(name)), | ||
| ] | ||
| + [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove positional arguments
| for k, v in [ | |
| ("name", cst_to_python(name)), | |
| ] | |
| + [ | |
| for k, v in [ |
|
|
||
| # decorator to annotate methods with method metadata | ||
| def method_parameter( | ||
| name: str, *, required: bool = False, merge: list[str] | None = None, docstring_prepend: str | None = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| name: str, *, required: bool = False, merge: list[str] | None = None, docstring_prepend: str | None = None | |
| *, name: str, required: bool = False, merge: list[str] | None = None, docstring_prepend: str | None = None |
| ] | ||
| + [ | ||
| (arg.keyword.value, cst_to_python(arg.value)) | ||
| for arg in args[1:] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| for arg in args[1:] | |
| for arg in args |
343e9db to
da64e5c
Compare
Adds applying schema to methods as a sub-command separate to apply schema to properties.
Supports