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 小时
- 30 天内合并 PR
- 22
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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 个 reaction ·
维护者通常 1 天内回复
-
enhancement
难度 4/5 3-5 天 新手友好度 35/100
confluentinc/cli#3072 ·
维护者通常 1 天内回复
-
bug
难度 3/5 1-2 天 新手友好度 45/100
confluentinc/cli#3056 · 3 条评论 ·
维护者通常 1 天内回复
相似的 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 天内回复