0b01001001/spectree

[BUG] generated operationId should not contain slash

harish2704 opened this issue · 0 comments

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