swagger-api / swagger-api/swagger-codegen
[Angular][Typescript] Delete with body generates not properly working service
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the inline Swagger 2.0 declaration and the generated TypeScript/Angular service linked in the issue, focusing on how the DELETE operation handles its body parameter. Compare this with the proposed HttpClient request approach; done means the generated service passes the body for DELETE requests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, typescript
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100