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

SMD: default value not parsed to SMD #41

Open
smyrman opened this issue Sep 11, 2019 · 0 comments
Open

SMD: default value not parsed to SMD #41

smyrman opened this issue Sep 11, 2019 · 0 comments

Comments

@smyrman
Copy link

smyrman commented Sep 11, 2019

Setting a default value through magic comments, e.g.:

//zenrpc:bar="bar" Foobar
func (srv Service) Foo(ctx contect.Context, foo string) (*Result, *zenrpc.Error) {
	// ...
}

Appear not too generate a Default value in the SMD:

{
	Name:        "foo",
	Optional:    true,
	Description: `Foobar`,
	Type:        smd.String,
},

Expect something ala:

_MfooAbar_defaultJSON, _ := json.Marshal("bar")
// ...
{
	Name:        "foo",
	Optional:    true,
	Description: `Foobar`,
	Type:        smd.String,
	Default:     json.RawMessage(_MfooAbar_defaultJSON),
},

zenrpc version v1.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants