CLI-3564: asyncapi import fails to import more complex schema
Maintainers usually reply within 1 day
@kcorman0 is already working on this.
Since May 9, 2023.
Assessment
This issue has not been assessed yet.
Description
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.
- Dominant language
- Go
- Stars
- 82
- Forks
- 37
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 22
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from confluentinc/cli
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
confluentinc/cli#3568 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
confluentinc/cli#3585 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 55/100
confluentinc/cli#3147 · 3 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
confluentinc/cli#3072 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 45/100
confluentinc/cli#3056 · 3 comments ·
Maintainers usually reply within 1 day
All issues in confluentinc/cli
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
-
bug triage/pending
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
core enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
forgelab-dev/lfa-forgenet#109 ·
Maintainers usually reply within 1 day
-
[mesheryctl] Enforce maximum positional argument bounds in system context view to prevent silent argument discardingPossibly taken @madhavzanwar claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
meshery/meshery#24055 · 1 comment ·
Maintainers usually reply within 1 day