CLI-3564: asyncapi import fails to import more complex schema
メンテナーはふだん 1 日以内に返信
@kcorman0 がすでに取り組んでいます。
2023年5月9日 から。
評価
この issue はまだ評価されていません。
説明
Hi,
first of all I would like to thank you for implementing confluent asyncapi import command. It's extremely useful!
Unfortunately, it looks like it doesn't handle $ref too well. Check out the following example.
confluent asyncapi import --file asyncapi.yaml --overwrite --unsafe-trace
asyncapi: 2.6.0
info:
title: Example
version: 1.0.0
channels:
entitlements-v1:
x-messageCompatibility: NONE
subscribe:
operationId: EntitlementsV1Subscribe
message:
$ref: "#/components/messages/EntitlementsV1Message"
components:
messages:
EntitlementsV1Message:
name: EntitlementsV1Message
contentType: application/json
payload:
title: EntitlementsV1Message
type: object
required:
- uuid
- level
properties:
uuid:
type: string
format: uuid
level:
$ref: "#/components/schemas/EntityLevel"
schemas:
EntityLevel:
type: string
enum:
- team
- org
The result is as follows:
POST /subjects/entitlements-v1-value/versions HTTP/1.1
User-Agent: Confluent-CLI/v3.10.0 (https://confluent.io; [email protected])
Content-Length: 251
Accept: application/vnd.schemaregistry.v1+json,application/vnd.schemaregistry+json; qs=0.9,application/json; qs=0.5
Content-Type: application/json
Accept-Encoding: gzip
{"schemaType":"JSON","schema":"{\"properties\":{\"level\":{\"$ref\":\"#/components/schemas/EntityLevel\"},\"uuid\":{\"format\":\"uuid\",\"type\":\"string\"}},\"required\":[\"uuid\",\"level\"],\"title\":\"EntitlementsV1Message\",\"type\":\"object\"}"}
HTTP/2.0 422 Unprocessable Entity
Content-Length: 390
Content-Type: application/vnd.schemaregistry.v1+json
Date: Tue, 18 Apr 2023 11:34:24 GMT
{"error_code":42201,"message":"Invalid schema {subject=entitlements-v1-value,version=0,id=-1,schemaType=JSON,references=[],schema={\"properties\":{\"level\":{\"$ref\":\"#/components/schemas/EntityLevel\"},\"uuid\":{\"format\":\"uuid\",\"type\":\"string\"}},\"required\":[\"uuid\",\"level\"],\"title\":\"EntitlementsV1Message\",\"type\":\"object\"}}, details: #: key [components] not found"}
[WARN] unable to register schema: 422 Unprocessable Entity
As far as I can see, the problem is caused by the fact that the body of POST /subjects/entitlements-v1-value/versions request contains message schema only - without components/schema part.
- 主要言語
- Go
- スター
- 82
- フォーク
- 37
- 平均マージ
- 1日 13時間
- マージ済み PR(30日)
- 22
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
confluentinc/cli のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
confluentinc/cli#3568 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
confluentinc/cli#3585 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
confluentinc/cli#3147 · コメント 3 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
confluentinc/cli#3072 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
confluentinc/cli#3056 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
confluentinc/cli の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
-
bug triage/pending
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
core enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
forgelab-dev/lfa-forgenet#109 ·
メンテナーはふだん 1 日以内に返信
-
[mesheryctl] Enforce maximum positional argument bounds in system context view to prevent silent argument discarding対応中かも @madhavzanwar が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
meshery/meshery#24055 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信