Cannot use different type for HTTP 404.
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- rust
調査の方向性
codegen.rsから始め、issueにある最小限のOpenAPI仕様からクライアントを生成し、200と404のレスポンスがどのように表現されるかに注目してください。生成されたget_state_elementメソッドが404のレスポンスタイプと200のレスポンスタイプを区別できれば完了です。issueでは特定のテストファイルは指定されていません。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Rust
- スター
- 1k
- フォーク
- 142
- 平均マージ
- 19時間 13分
- マージ済み PR(30日)
- 16
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
oxidecomputer/progenitor のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
oxidecomputer/progenitor#1345 ·
メンテナーはふだん 1 日以内に返信
-
Generated client treats a declared 304 Not Modified as UnexpectedResponse対応中かも @jjant が 6 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
oxidecomputer/progenitor#1462 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 58/100
oxidecomputer/progenitor#1457 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
oxidecomputer/progenitor#1444 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
oxidecomputer/progenitor#1382 ·
メンテナーはふだん 1 日以内に返信
oxidecomputer/progenitor の issue をすべて見る
似ている issue
-
area: cli good first issue type: feature
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
[Bug] Windows Ghidra provider rejects a PATH-only JDK: bare `java.exe` probe fails with Win32 87オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
renaming a provider to a taken name fails with a raw sql error対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンarea:storage kind:bug priority:p3 ready
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
bug bugfix
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
storytold/photocraft#16975 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信