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] generated operationId should not contain slash #263

Closed
harish2704 opened this issue Oct 9, 2022 · 0 comments · Fixed by #264
Closed

[BUG] generated operationId should not contain slash #263

harish2704 opened this issue Oct 9, 2022 · 0 comments · Fixed by #264

Comments

@harish2704
Copy link
Contributor

Describe the bug
In my understanding, operationId used openapi spec basically serves the purpose of a method name . If that is correct, it should not contain slash ( "/"). But currently, generated operationId will contain slash because it is derived from path used in the router. This slash can break generated HTML documentation ( it at-least breaks the html2 generator )

To Reproduce
Steps to reproduce the behavior:

  • clone this repo https://git.harishk.in/harish2704/language-identification-api
  • Run the server and download generated openapi.json file ( wget 'http://127.0.0.1:8000/apidoc/openapi.json' )
  • Now generate html documentation from this spec ( openapi-generator-cli generate -i openapi.json -g html2 )
  • Open the generated file in the browser, check the developer console, we can see many javascript errors. We can also see the following issues
    • we will not be able to switch tab in the generated client-side code section.
    • Syntax highlight didn't worked for generated code
    • Response schema was not displayed in the browser.

Expected behavior
Expecting a fully functional generated HTML file ( like this https://git.harishk.in/harish2704/language-identification-api/src/branch/main/generated/index.html ) But produced HTML was broken

Error Message
There were no error messages generated regarding this issue

Desktop (please complete the following information):

  • OS: Linux
  • Version: 36

Python Information (please complete the following information):

Additional context
Nothing

harish2704 added a commit to harish2704/spectree that referenced this issue Oct 9, 2022
kemingy pushed a commit that referenced this issue Oct 10, 2022
Fix: Replace '/' with _ in operationId

Fixes #263

Signed-off-by: Harish Karumuthil <[email protected]>

Signed-off-by: Harish Karumuthil <[email protected]>
kemingy pushed a commit that referenced this issue Oct 15, 2022
Fix: Replace '/' with _ in operationId

Fixes #263

Signed-off-by: Harish Karumuthil <[email protected]>

Signed-off-by: Harish Karumuthil <[email protected]>
(cherry picked from commit b96a490)
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

Successfully merging a pull request may close this issue.

1 participant