kafbat / kafka-ui

Open-Source Web UI for managing Apache Kafka clusters
http://ui.docs.kafbat.io
Apache License 2.0
593 stars 79 forks source link

FE: `Content NOT SUPPORTED: keyword "id", use "$id" for schema ID` #476

Open vicziani opened 3 months ago

vicziani commented 3 months ago

Issue submitter TODO list

Describe the bug (actual behavior)

I'am using the Apicurio Schema Registry. After I create a JSON schema and try to send a message, I get the following error message:

Content NOT SUPPORTED: keyword "id", use "$id" for schema ID

JSON Schema:

{
  "$id": "https://training.com/EmployeeHasBeenCreatedEvent.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "EmployeeHasBeenCreatedEvent",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "format": "int64",
      "description": "The employee's id."
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "description": "The employee's name."
    }
  }
}

Reading messages based on the schema works well.

Expected behavior

Send the message.

Your installation details

Same with v1.0.0 and 4de0d53.

  schema-registry:
    image: apicurio/apicurio-registry-mem:2.6.1.Final
    ports: 
      - "8081:8080"
  kafka-ui:
    #image: ghcr.io/kafbat/kafka-ui:v1.0.0
    image: ghcr.io/kafbat/kafka-ui:4de0d5330d0c615e70fd9693bba265e6536029e9
    depends_on:
      - kafka
      - schema-registry
    ports:
      - 8082:8080
    environment:
      - KAFKA_CLUSTERS_0_NAME=local
      - KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS=kafka:9093
      - KAFKA_CLUSTERS_0_SCHEMAREGISTRY=http://schema-registry:8080/apis/ccompat/v7
      - DYNAMIC_CONFIG_ENABLED='true'

Steps to reproduce

  1. Create schema
  2. Create topic
  3. Send message

Screenshots

image image image

The JSON is generated by Kafka UI.

Logs

Nothing appears in the log.

Additional context

No response

github-actions[bot] commented 3 months ago

Hi vicziani! 👋

Welcome, and thank you for opening your first issue in the repo!

Please wait for triaging by our maintainers.

As development is carried out in our spare time, you can support us by sponsoring our activities or even funding the development of specific issues. Sponsorship link

If you plan to raise a PR for this issue, please take a look at our contributing guide.

Haarolean commented 3 months ago
vicziani commented 3 months ago
KAFKA_CLUSTERS_0_SCHEMAREGISTRY=http://schema-registry:8080/apis/ccompat/v7

As you can see on the screenshots, the Kafka UI can download the schema, using it when consuming messages, create sample JSON based on the schema. It only throws error while producing message.

vicziani commented 3 months ago

I tried with another schema draft(http://json-schema.org/draft-07/schema#).

Kafka UI can download the schema, using it when consuming messages, create sample JSON based on the schema.

But another error message while producing message: Content no schema with key or ref "http://json-schema.org/draft-07/schema#". Kafka UI supports only the draft https://json-schema.org/draft/2020-12/schema?!

Haarolean commented 3 months ago

@Nilumilak can you take a look, please? It looks like a frontend issue, the validator either can't parse schema references or something.

kbzowski commented 1 month ago

+1