Skip to content

Wrong name generation break client #2255

Open
@cesarve77

Description

@cesarve77

Description

    "/upload?id={id}": {
      "post": {
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "File id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "description": "Upload file information",
        "responses": {
          "200": {
            "description": "response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UploadFile"
                  }
                }
              }
            }
          }
        },
        "summary": "",
        "tags": [
          "Upload - File"
        ],
        "requestBody": {
          "description": "Upload files",
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "fileInfo": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "alternativeText": {
                        "type": "string"
                      },
                      "caption": {
                        "type": "string"
                      }
                    }
                  },
                  "files": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              }
            }
          }
        }
      }
    },

is generating:

export const postUpload?id=byId = <ThrowOnError extends boolean = false>(options: Options<PostUpload_id_byIdData, ThrowOnError>) => {
    return (options.client ?? _heyApiClient).post<PostUpload_id_byIdResponses, unknown, ThrowOnError>({
        ...formDataBodySerializer,
        security: [
            {
                scheme: 'bearer',
                type: 'http'
            }
        ],
        url: '/upload?id={id}',
        ...options,
        headers: {
            'Content-Type': null,
            ...options.headers
        }
    });
};

note the ? in the function name

Reproducible example or configuration

https://stackblitz.com/edit/hey-api-client-fetch-example

OpenAPI specification (optional)

No response

System information (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature 🚀New feature or requestprioritized 🚚This issue has been prioritized and will be worked on soon

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions