Closed alok87 closed 4 years ago
panic: 422 : Unrecognized field: schemaType
package main import ( "encoding/binary" "encoding/json" "fmt" "io/ioutil" "github.com/riferrei/srclient" ) func main() { topic := "loader-datapipe.inventory.products" schemaRegistryClient := srclient.CreateSchemaRegistryClient("XXXX:8081") schema, err := schemaRegistryClient.GetLatestSchema(topic, false) if schema == nil { schemaBytes, _ := ioutil.ReadFile("complexType.avsc") schema, err = schemaRegistryClient.CreateSchema(topic, string(schemaBytes), srclient.Avro, false) if err != nil { panic(fmt.Sprintf("Error creating the schema %s", err)) } } schemaIDBytes := make([]byte, 4) binary.BigEndian.PutUint32(schemaIDBytes, uint32(schema.ID())) fmt.Printf("schemaIDBytes:%v\n" schemaIDBytes) }
Error
Program