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

how to use a custom schema definition? #11

Open
Omarabdul3ziz opened this issue Jun 30, 2024 · 0 comments
Open

how to use a custom schema definition? #11

Omarabdul3ziz opened this issue Jun 30, 2024 · 0 comments

Comments

@Omarabdul3ziz
Copy link

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?

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

No branches or pull requests

1 participant