`apispec` ignores `oneOf` from `marshmallow-oneofschema`
メンテナーはふだん 1 日以内に返信
評価
調査の方向性
ソースファイルやテストパスは指定されていないため、まず apispec における marshmallow-oneofschema の処理箇所を探し、関連するスキーマ生成テストを読んでください。AerthlingsShopOffer の例を再現し、その後、oneOf と両方の具体的な offer スキーマが出力されることを確認するリグレッションカバレッジを追加してください。
索引モデルが issue の本文から書いたものです。
説明
I need oneOf in my schema:
class AerthlingsShopOffer(OneOfSchema):
"""Polymorphic offer type discriminated by the 'type' field."""
type_field = "type"
type_schemas = {
"character": AerthlingsCharacterOffer,
"mutation_point": AerthlingsMpOffer,
}
Marshmallow doesn't seem to support this. Fortunately, there is an extension, marshmallow-oneofschema. Unfortunately, when presented with the class above, apispec silently ignores it, producing
"AerthlingsShopOffer": {
"type": "object",
"properties": {}
},
and omitting AerthlingsCharacterOffer and AerthlingsMpOffer entirely.
I have a fix for this, but I think it requires discussion, and I have not yet written a unit test for it. If you think this is worth doing, I can complete the work and submit a PR. If not, that is no problem for me; I can continue to use my forked apispec in my own project.
- 主要言語
- Python
- スター
- 1.2k
- フォーク
- 210
- 平均マージ
- 2日 1時間
- マージ済み PR(30日)
- 4
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
marshmallow-code/apispec のほかの issue
-
DateTime(format="timestamp") generates invalid OpenAPI schema using min instead of minimum対応中かも @Sanjays2402 が 102 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
marshmallow-code/apispec#1064 ·
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
marshmallow-code/apispec#750 · コメント 1 件 · リアクション 5 件 ·
メンテナーはふだん 1 日以内に返信
-
Dependency Dashboardオープン
難易度 1/5 1時間未満 初心者へのやさしさ 30/100
marshmallow-code/apispec#1033 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
marshmallow-code/apispec#981 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Date and DateTime with format argument not rendered correctly対応中かも @jbbqqf が 173 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 30/100
marshmallow-code/apispec#938 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
marshmallow-code/apispec の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
btclib-org/btclib#3062 ·
メンテナーはふだん 1 日以内に返信
-
area:evals area:infra enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
jse-avl/support-bot#4 · コメント 1 件 ·
-
bug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
qte77/agentic-job-offer-to-application-kit#487 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
btclib-org/btclib-wallet#801 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
documentation good first issue
難易度 1/5 1〜3時間 初心者へのやさしさ 94/100