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

[Angular][Typescript] Delete with body generates not properly working service #9381

Open
tamasfoldi opened this issue Apr 17, 2019 · 3 comments

Comments

@tamasfoldi
Copy link

tamasfoldi commented Apr 17, 2019

Description

I'm trying to generate an typescript/angular service with a delete method which has a body param, but the generated services does not use the body param. You can find the generated service's code here and you can see that the body param is not used anywhere.

Swagger-codegen version

2.4.4

Swagger declaration file content or url

If you post the code inline, please wrap it with

swagger: '2.0'
info:
  description: "DeleteBody"
  version: v0.0.1
  title: Multi Delete API
basePath: /
tags:
  - name: 'multi'
schemes:
  - http
paths:
  '/multi/delete':
    delete:
      summary: delete multiple
      description: >-
        Multi delete
      operationId: multiDelete
      schemes:
        - http
      consumes:
        - application/json
      parameters:
        - name: body
          in: body
          required: false
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: successful operation
Command line used for generation

Generated on https://editor.swagger.io/ with Generate Client -> typescript-angular

My suggestion would be that to use httpClient.request({method}) instead of httpClient.{method} with this solutiondelete accepts a body param.

@tamasfoldi tamasfoldi changed the title [Angular][Typescript] Delete with body generates wrong service [Angular][Typescript] Delete with body generates not properly working service Apr 17, 2019
@bsokolslalom
Copy link

We are also seeing this with PUT and POST. The body param is left out, so the third param, the options object, becomes the body.

@fercaveri
Copy link

Please add this important feature, i have the same issue in my API

@mdfynadamas
Copy link

I have the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants