Skip to content

how to use a custom schema definition? #11

@Omarabdul3ziz

Description

@Omarabdul3ziz

i faced an issue while trying to register this service to my API and create the docs for it

The service

type Cal struct{}

type PlusArg struct {
	Num int
}

type PlusReply struct {
	Num int
}

func (c *Cal) Plus(arg *PlusArg, reply *PlusReply) error {
	ans := arg.Num + 1
	reply.Num = ans
	return nil
}

The error

json: error calling MarshalJSON for type openrpc_document.ContentDescriptorOrReference: json: error calling MarshalJSON for type *openrpc_document.JSONSchema: json: error calling MarshalJSON for type *openrpc_document.JSONSchema: failed to marshal any one of the object properties

I noticed this section on the docs https://github.com/etclabscore/go-openrpc-reflect/blob/master/README.md#library-limitations but the link to using a custom schema is just a TODO https://github.com/etclabscore/go-openrpc-reflect/blob/master/README.md#TODO

any help please about what should i do?

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