Skip to content

SMD: default value not parsed to SMD #41

@smyrman

Description

@smyrman

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions