`Inline` fails on a recursive schema file shared through a response file: `reference ... not found in analysis phase`
メンテナーはふだん 1 日以内に返信
関連するプルリクエストがすでにマージされています。
- #288 @TristanSpeakEasy による — マージ済み
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 55/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- go, openapi
調査の方向性
Start by tracing openapi.Inline and the nested reference analysis for external response and schema files; the report does not name implementation or test files. Reproduce with the three operations and recursive Folder.yaml schema, then compare with two operations and a single-file document. Done when the three-operation case inlines successfully for OpenAPI 3.0.3 and 3.1.0, with the recursive reference targeting #/components/schemas/__Folder_yaml.
索引モデルが issue の本文から書いたものです。
説明
Summary
openapi.Inline (and openapi spec inline) fails when a self-referencing schema in its own file is reached through a response file that three or more operations reference. With two operations it inlines fine, and so does the same document written in one file.
Reproduction
openapi.yaml:
openapi: 3.0.3
info: {title: t, version: "1"}
paths:
/f1:
get:
responses:
"200": {$ref: ./responses/folder.yaml}
/f2:
get:
responses:
"200": {$ref: ./responses/folder.yaml}
/f3:
get:
responses:
"200": {$ref: ./responses/folder.yaml}
responses/folder.yaml:
description: ok
content: {application/json: {schema: {$ref: ../schemas/Folder.yaml}}}
schemas/Folder.yaml:
properties:
parents:
items: {$ref: ./Folder.yaml}
$ openapi spec inline openapi.yaml
Processing OpenAPI document: openapi.yaml
Error: failed to inline OpenAPI document: failed to inline references: failed to inline nested references in : failed to inline schemas: failed to inline schema: failed to inline schema: reference schemas/Folder.yaml#/components/schemas/__Folder_yaml not found in analysis phase
The library call (openapi.Unmarshal, then openapi.Inline with ResolveOptions{RootDocument: doc, TargetLocation: <absolute path>} and RemoveUnusedComponents: true) returns the same error.
Expected result
The document is inlined, as it is with /f3 removed: each response gets the Folder schema and the recursive ref points at #/components/schemas/__Folder_yaml. The same three operations also inline when they reference ./schemas/Folder.yaml directly, or when the response and the schema are in the root's components (one file).
Actual result
The error above, for openapi: 3.0.3 and 3.1.0 alike, and with four operations too. The reference it can't find, #/components/schemas/__Folder_yaml, is the name the inliner itself gives the recursive schema, here resolved against schemas/Folder.yaml.
Version
v1.26.0 (also main, d269643). CLI from go install github.com/speakeasy-api/openapi/cmd/openapi@latest (v0.0.0-20261016011534-d2696438ec74).
- 主要言語
- Go
- スター
- 276
- フォーク
- 21
- 平均マージ
- 1日 5時間
- マージ済み PR(30日)
- 20
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
speakeasy-api/openapi のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
speakeasy-api/openapi#289 ·
メンテナーはふだん 1 日以内に返信
-
`openapi spec lint --fix` drops node-level fixes and can duplicate paths対応中かも @RaphaelFakhri が 5 日前に担当しました。 オープン
難易度 4/5 1〜2日 初心者へのやさしさ 35/100
speakeasy-api/openapi#280 ·
メンテナーはふだん 1 日以内に返信
speakeasy-api/openapi の issue をすべて見る
似ている issue
-
Object Manager 1.13 resets a vCLU after sending a project対応中かも @tciunelis が今日担当しました。 オープンbug ready ticket
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
Domktorymysli/vclu#152 ·
メンテナーはふだん 1 日以内に返信
-
bug converter
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
grafana/sigma-rule-deployment#435 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
🤖 verification skills: harden check.sh and verify.sh argument and file handling (#391 follow-ups)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
google/go-containerregistry#2491 ·
メンテナーはふだん 1 日以内に返信