-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: text to speech doc show request body #2036
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -629,6 +629,12 @@ class TextToSpeech(APIView): | |
| authentication_classes = [TokenAuth] | ||
|
|
||
| @action(methods=['POST'], detail=False) | ||
| @swagger_auto_schema(operation_summary=_("text to speech"), | ||
| operation_id=_("text to speech"), | ||
| manual_parameters=ApplicationApi.TextToSpeech.get_request_params_api(), | ||
| request_body=ApplicationApi.TextToSpeech.get_request_body_api(), | ||
| responses=result.get_default_response(), | ||
| tags=[_('Application')]) | ||
| @has_permissions( | ||
| ViewPermission([RoleConstants.ADMIN, RoleConstants.USER, RoleConstants.APPLICATION_ACCESS_TOKEN], | ||
| [lambda r, keywords: Permission(group=Group.APPLICATION, | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The code snippet appears to be defining an API view endpoint specifically for text-to-speech functionality. Here's a brief analysis: Potential Issues:
Overall, the code looks structured correctly based on its purpose and intent. If you have additional requirements or constraints, adjusting these parts accordingly might be beneficial. |
||
|
|
||
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.
In your updated code for the
get_request_params_api()function withinTextToSpeech, there are a few minor adjustments and clarifications that can be made:Remove
@staticmethodDecorator: Since you have defined both static methods (get_request_params_api()andget_request_body_api()) for theTextToSpeechclass, it's redundant to use both decorators on all these methods. You only need one decorator per method.Correct Parameter Names: In the
get_request_params_api()function, the parameter names should not include underscores (e.g.,'text_to_speech'). Use hyphens instead if needed.Here is the revised version of your code:
These changes ensure that the Python syntax is correct without unnecessary repetition. Let me know if you need further modifications!