openapi-generators / openapi-generators/openapi-python-client

Missing references in API generation process

未關閉
#952 3 則留言 2 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
Python
星號
2k
分支
293
平均合併
34 分鐘
30 天內合併 PR
1

描述

Describe the bug
While trying to generate the OpenAPI client, I come across a bug that not only modifies several files unnecessarily but also displays a warning message about endpoint generating, which root cause is unclear to me:

Warning(s) encountered while generating. Client was generated, but some pieces may be missing

WARNING parsing POST /index/create within index. Endpoint will not be generated.

Could not find reference in parsed models or enums



Unable to process schema /components/schemas/Index:

Value {'object_type': 'IndexParams', 'nlist': 128} is not valid, only None is allowed

Failure to process schema has resulted in the removal of:
/components/schemas/Index
/components/schemas/IndexInSpec

Schema(title=None, multipleOf=None, maximum=None, exclusiveMaximum=None, minimum=None, exclusiveMinimum=None, maxLength=None, minLength=None, pattern=None, maxItems=None, minItems=None, uniqueItems=None, maxProperties=None, minProperties=None, required=None, enum=None, const=None, type=None, allOf=[], oneOf=[Reference(ref='#/components/schemas/IndexParams'), Schema(title=None, multipleOf=None, maximum=None, exclusiveMaximum=None, minimum=None, exclusiveMinimum=None, maxLength=None, minLength=None, pattern=None, maxItems=None, minItems=None, uniqueItems=None, maxProperties=None, minProperties=None, required=None, enum=None, const=None, type=<DataType.NULL: 'null'>, allOf=[], oneOf=[], anyOf=[], schema_not=None, items=None, properties=None, additionalProperties=None, description=None, schema_format=None, default=None, nullable=False, discriminator=None, readOnly=None, writeOnly=None, xml=None, externalDocs=None, example=None, deprecated=None)], anyOf=[], schema_not=None, items=None, properties=None, additionalProperties=None, description=None, schema_format=None, default={'object_type': 'IndexParams', 'nlist': 128}, nullable=False, discriminator=Discriminator(propertyName='object_type', mapping=None), readOnly=None, writeOnly=None, xml=None, externalDocs=None, example=None, deprecated=None)

OpenAPI Spec File
A link to an OpenAPI document which produces this issue. Ideally, write a minimal reproduction only containing the problematic pieces.
Creating the new client: https://github.com/openapi-generators/openapi-python-client?tab=readme-ov-file#create-a-new-client

Desktop (please complete the following information):

  • OS: Windows 11 Enterprise Version 22H2
  • Python Version: 3.9.13
  • openapi-python-client version: 0.17.2

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從 issue 中連結的 create-a-new-client 說明開始,並使用回報的 OpenAPI 用戶端產生流程重現該警告。調查為什麼會移除對 Index、IndexInSpec 和 IndexParams 的參照,然後確認產生流程可以在沒有該警告的情況下完成,並保留這些 schema。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
openapi, python
領域
api, tooling
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
需要釐清
新手友好度
28/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。