[Typescript][Angular] Status Code 204: Accept-Content Header
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 62/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- angular, typescript
Hướng nghiên cứu
Bắt đầu trong modules/openapi-generator/src/main/resources/Javascript/ApiClient.mustache và kiểm tra cách contentTypes được xử lý cho phản hồi 204 trong khai báo OpenAPI được cung cấp. Tạo client TypeScript/Angular và quan sát các header của request. Hoàn tất khi phản hồi 204 rỗng không còn tạo ra header Accept-Content application/json.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
Wrong Accept-Content Header for empty response types
Swagger-codegen version
3.0.14
Swagger declaration file content or url
delete:
operationId: deletePartnerByID
tags:
-Partner
summary: Deletes a communication partner
parameters:
- name: deletePartnerByID
in: path
description: ID of partner to delete
required: true
schema:
type: integer
format: int64
responses:
204:
description: OK
400:
description: Invalid ID supplied
content:
application/json: {}
404:
description: Communication partner not found
content:
application/json: {}
Command line used for generation
not needed
Steps to reproduce
Follow the Guideline How to make OpenAPI 3.0 to send an empty Accept-Content Header
https://swagger.io/docs/specification/describing-responses/
(In Our Case for HTTP Status code 204)
Test the generated code.
Watch Request Headers
See Accept-Content Header "application/json"
Related issues/PRs
Suggest a fix/enhancement
Fix this code in modules/openapi-generator/src/main/resources/Javascript/ApiClient.mustache
var contentType = this.jsonPreferredMime(contentTypes);
if (contentType) {
if(contentType != 'multipart/form-data') {
request.type(contentType);
}
} else if (!request.header['Content-Type']) {
request.type('application/json');
}
- Ngôn ngữ chính
- Mustache
- Star
- 17.8k
- Fork
- 6k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của swagger-api/swagger-codegen
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
swagger-api/swagger-codegen#12755 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
swagger-api/swagger-codegen#12445 ·
-
security vulnerability
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
swagger-api/swagger-codegen#11942 ·
-
[JAVA] Non compilable enums generated with property errorOnUnknownEnum=trueCó thể đã có người làm @HiagoW đã nhận 1459 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
swagger-api/swagger-codegen#11812 · 1 reaction ·
-
security vulnerability
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
swagger-api/swagger-codegen#11594 ·
Tất cả issue của swagger-api/swagger-codegen
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
FuRongJun-1999/dsh-memory#404 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
ActivityWatch/aw-notify-rs#47 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Workflow.schedule stops when a cron deadline passes before sleepCó thể đã có người làm @HuaTNA đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày