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

Code Generator creates unsafe interface method names #360

Closed
dammitjanet opened this issue Apr 10, 2024 · 2 comments · Fixed by #562
Closed

Code Generator creates unsafe interface method names #360

dammitjanet opened this issue Apr 10, 2024 · 2 comments · Fixed by #562
Assignees
Labels
bug Something isn't working

Comments

@dammitjanet
Copy link

Describe the bug
if the OpenAPI specification URL final part ("/api/manage/2fa") starts with a number, then the resulting method is invalid as the resulting method starts with that number

        [Headers("Accept: text/plain, application/json, text/json")]
        [Post("/api/manage/2fa")]
        Task<IApiResponse> 2faAsync([Body] TwoFactorRequest? body = default, CancellationToken cancellationToken = default);

in this case, Invalid token 2f

Support Key: 7l7irxz

OpenAPI Specifications

       "/api/manage/2fa": {
            "post": {
                "tags": [
                    "Manage"
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/TwoFactorRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success"
                    },
                    "400": {
                        "description": "Bad Request"
                    },
                    "404": {
                        "description": "Not Found",
                        "content": {
                            "text/plain": {
                                "schema": {
                                    "$ref": "#/components/schemas/ProblemDetails"
                                }
                            },
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ProblemDetails"
                                }
                            },
                            "text/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ProblemDetails"
                                }
                            }
                        }
                    }
                }
            }
        },

Additional context
The OpenAPI spec is a Swagger generated

@dammitjanet dammitjanet added the bug Something isn't working label Apr 10, 2024
@dammitjanet
Copy link
Author

This is something that can be resolved with the same workaround noted #361

@christianhelle
Copy link
Owner

@Fargekritt resolved this in #562

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

Successfully merging a pull request may close this issue.

2 participants