Skip to content

Getting Schema is not marshalled correctly #198

@ili16

Description

@ili16

When running the go code to retrieve schema information as described in the documentation;

package main

import (
  "context"
  "fmt"

  "github.com/weaviate/weaviate-go-client/v4/weaviate"
)

func main() {
  cfg := weaviate.Config{
    Host:   "localhost:8080",
    Scheme: "http",
  }
  client, err := weaviate.NewClient(cfg)
  if err != nil {
    panic(err)
  }

  schema, err := client.Schema().Getter().Do(context.Background())
  if err != nil {
    panic(err)
  }
  fmt.Printf("%v", schema)

I receive a hexadecimal representation of the Dump:

Schema: &{{[0xc0000be0a0] }}

I can fix that manually by marshalling it myself:

jsonSchema, err := json.MarshalIndent(schema, "", "  ")

if err != nil {
	panic(err)
}

fmt.Printf("%s\n", jsonSchema)

The python client and a curl work fine so I would expect the go-client to behave the same. I guess the problem lies in the Getter.Do Function but I do not know how to test the change locally

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions