Support nested schema inside object properties

オープン
#379 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
42/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
openapi, python
領域
api

調査の方向性

まず、YAMLレスポンススキーマ、オブジェクトプロパティ、および #/components/schemas 参照がどのように表現され、解決されるかを追跡します。現在のOpenAPI生成パスが、プロパティの説明を持つ参照されたネストされたスキーマをサポートしているか確認します。AddressInfoの例について、ネストされた参照と説明を保持した有効な出力を生成でき、このケースのテストカバレッジがあることを完了条件とします。

索引モデルが issue の本文から書いたものです。

説明

question

Hi. Maybe I missed, I'm trying to nest a schema to object type properties, but I couldn't found the way to solve this situation.

responses:
  200:
    content:
      application/json:
        schema: 
          type: object
          properties:
            addressInfo:
              $ref: "#/components/schemas/AddressInfo"
              description: Address info.

First I wrote below, but it doesn't work.

schema: 
  type: object
   properties:
     addressInfo:
       $ref: AddressInfo
       description: Address info.

This is one of options, but it can't declare description

schema: 
  type: object
   properties:
     addressInfo: AddressInfo
     # description?

manual binding is not working because AddressInfo is not in #/components/schema

schema: 
  type: object
   properties:
     addressInfo:
       $ref: "#/components/schemas/AddressInfo" # not defined. 
       description: Address info.

Is there a proper solution for this? 🙏 Thanks.

主要言語
Python
スター
1.2k
フォーク
210
平均マージ
2日 1時間
マージ済み PR(30日)
4

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

marshmallow-code/apispec のほかの issue

marshmallow-code/apispec の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。