karatelabs / karate-addons

1 stars 1 forks source link

Can registre JSON schemas #2

Open fjvierap opened 9 months ago

fjvierap commented 9 months ago

For Kafka addon seems that is possible to register avro schemas but json schema seems to fail.

For instance when I try to register this json schema:

{
  "definitions": {
    "record:oms.order": {
      "type": "object",
      "required": [
        "id"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string"
        }
      }
    }
  },
  "$ref": "#/definitions/record:oms.order"
}

I got this error: [ERROR] KafkaTest.testFeature:13 No type: {"definitions":{"record:oms.order":{"type":"object","required":["id"],"additionalProperties":false,"properties":{"id":{"type":"string"}}}},"$ref":"#/definitions/record:oms.order"}

Am I doing something wrong or JSON schema is not supported yet?

ptrthomas commented 9 months ago

@fjvierap yes, JSON scema is not suported, I would expect this not needed because "plain JSON" serialization works. if this is something that is a blocker or expected in your registry / env etc, please do share more details or example and we will look at feasibility

fjvierap commented 9 months ago

@ptrthomas that is something it is not critical for us. Thanks