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

Path '#-datamodel-code-generator-#-root-#-special-#' is added to the '/' endpoint #296

Open
Aedial opened this issue Nov 23, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@Aedial
Copy link

Aedial commented Nov 23, 2022

When generating from a schema with a '/' endpoint, the root path ('#-datamodel-code-generator-#-root-#-special-#') is added to the endpoint, transforming it into '/#-datamodel-code-generator-#-root-#-special-#'.
When used as a fastapi endpoint, '/' returns 404, showing that the it broke the endpoint. The endpoint responds normally when the root path is removed manually.

@Aedial
Copy link
Author

Aedial commented Nov 23, 2022

Minimal working example :

{
  "paths": {
    "/": {
      "get": {
        "operationId": "GetRoot",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          }
        }
      }
    }
  }
}

@koxudaxi koxudaxi added the bug Something isn't working label Jan 6, 2023
@harryjubb
Copy link

I'm also hitting this bug. Any reason why this is happening, and is there anything that can be done to avoid it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants