Cannot use different type for HTTP 404.
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- rust
- Lĩnh vực
- backend-api-design, tooling
Hướng nghiên cứu
Bắt đầu với codegen.rs và tạo một client từ đặc tả OpenAPI tối thiểu trong issue, tập trung vào cách các response 200 và 404 được biểu diễn. Công việc được xem là hoàn tất khi phương thức get_state_element được tạo phân biệt kiểu response 404 với kiểu response 200; issue không nêu tên file test cụ thể nào.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I want to use progenitor, but generated client uses same response type for HTTP 404 as it has for HTTP 200.
Here is the most simple reproducible spec:
openapi: "3.0.2"
info:
title: Demo That Triggers It
version: 0.1.0
description: "Here you go"
contact:
name: Demo
servers:
- url: http://localhost:12346/
paths:
/items/{key}:
get:
summary: get_state_element
operationId: get_state_element
tags: [ "hi-there" ]
parameters:
- name: key
in: path
required: true
schema:
type: string
responses:
200:
$ref: "#/components/responses/StateMapElementResponse2"
404:
"$ref": "#/components/responses/NotFound"
components:
parameters:
rollup_height:
name: rollup_height
in: query
description: The height of the rollup to query. If not provided, the rollup head is used.
required: false
schema:
type: integer
minimum: 0
responses:
StateMapElementResponse2:
description: Response containing the value of a `StateMap` element.
content:
application/json:
schema:
type: object
properties:
data:
type: object
properties:
key:
$ref: "#/components/schemas/AnyJsonValue"
value:
$ref: "#/components/schemas/AnyJsonValue"
required:
- key
- value
meta:
$ref: "#/components/schemas/AnyJsonValue"
required:
- data
NotFound:
description: The requested resource was not found.
content:
application/json:
schema:
type: object
properties:
errors:
type: array
items:
$ref: "#/components/schemas/Error"
meta:
$ref: "#/components/schemas/AnyJsonValue"
required:
- errors
schemas:
AnyJsonValue:
description: "Any JSON type, including null."
nullable: true
oneOf:
- type: string
title: "String"
- type: number
title: "Number"
- type: boolean
title: "Boolean"
- type: array
title: "Array"
items:
x-stainless-any: true
- type: object
title: "Object"
additionalProperties: true
Error:
type: object
properties:
status:
type: integer
format: int32
description: HTTP status code related to this error
title:
type: string
details:
$ref: "#/components/schemas/AnyJsonValue"
required:
- status
- title
- details
Here is part of the codegen.rs:
impl Client {
pub async fn get_state_element<'a>(
&'a self,
key: &'a str,
) -> Result<
ResponseValue<types::GetStateElementResponse>,
Error<types::GetStateElementResponse>,
> { todo!("omitted"); }
}
I am struggling to find what causes the problem, that Error variant is the same as success.
- Ngôn ngữ chính
- Rust
- Star
- 1k
- Fork
- 142
- Merge trung bình
- 19 giờ 13 phút
- Pull request đã merge (30 ngày)
- 16
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 oxidecomputer/progenitor
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
oxidecomputer/progenitor#1345 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Generated client treats a declared 304 Not Modified as UnexpectedResponseCó thể đã có người làm @jjant đã nhận 6 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
oxidecomputer/progenitor#1462 ·
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 58/100
oxidecomputer/progenitor#1457 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
oxidecomputer/progenitor#1444 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
oxidecomputer/progenitor#1382 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của oxidecomputer/progenitor
Issue tương tự
-
[Bug]: Add Data's question says "Link to the file" for a GeoPackage where small tables are copiedĐang mởunconfirmed possible issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
jerney-nexus/epikrise#364 ·
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 62/100
Yeachan-Heo/gajae-code#8058 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug daemon
Độ 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
-
good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày