Skip to content

[TypeScript fetch] doubling options #8067

@ElfenLiedGH

Description

@ElfenLiedGH
Description
Swagger-codegen version

2.3.1

Swagger declaration file content or url
  /Companies/change-stream:
    post:
      tags:
        - Company
      summary: Create a change stream.
      operationId: Company.createChangeStream__post_Companies_change-stream
      parameters:
        - name: options
          in: formData
          required: false
          type: string
          format: JSON
      responses:
        '200':
          description: Request was successful
          schema:
            type: file
      deprecated: false
    get:
      tags:
        - Company
      summary: Create a change stream.
      operationId: Company.createChangeStream__get_Companies_change-stream
      parameters:
        - name: options
          in: query
          required: false
          type: string
          format: JSON
      responses:
        '200':
          description: Request was successful
          schema:
            type: file
      deprecated: false
Command line used for generation
Steps to reproduce

https://editor.swagger.io/#

menu generate client->typescript fetch

Related issues/PRs
Suggest a fix/enhancement

generated code

    /**
     * 
     * @summary Create a change stream.
     * @param {string} [options] 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    companyCreateChangeStreamPostCompaniesChangeStream(options?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<any> {
        const localVarFetchArgs = CompanyApiFetchParamCreator(configuration).companyCreateChangeStreamPostCompaniesChangeStream(options, options);
        return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => {
            return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
                if (response.status >= 200 && response.status < 300) {
                    return response.json();
                } else {
                    throw response;
                }
            });
        };
    },

swagger api's generated auto by loopback v3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions