Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Following the example i get unknown field "schemaType" response from schema registry #11

Closed
alok87 opened this issue Aug 19, 2020 · 0 comments · Fixed by #12
Closed

Comments

@alok87
Copy link
Contributor

alok87 commented Aug 19, 2020

Error

panic: 422 : Unrecognized field: schemaType

Program

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)

}
@alok87 alok87 changed the title Following the example i get unknown file schemaType response from schema registy Following the example i get unknown field "schemaType" response from schema registry Aug 19, 2020
This was referenced Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant