Skip to content

Conversation

@wy-z
Copy link
Contributor

@wy-z wy-z commented Dec 12, 2016

  • [api] Make the parameters optional
  • [model] Use pointers whenever possible

Signed-off-by: weiyang weiyang.ones@gmail.com

wy-z added 2 commits December 12, 2016 18:11
Signed-off-by: weiyang <weiyang.ones@gmail.com>
Signed-off-by: weiyang <weiyang.ones@gmail.com>
@NfNitLoop
Copy link

If I'm reading this right, (I'm not familiar w/ the codegen code base), it updates it so that function calls instead of being, ex:

GetFoo(int, string)

They're now:

GetFoo(map[string]interface{})

So the type and number of the parameters is completely hidden from the call interface, and only checked at runtime. (While #4308 only hides the type of parameters, but keeps their number and name as part of the generated code.)

@NfNitLoop
Copy link

NfNitLoop commented Dec 12, 2016

Also, in #4306 it was pointed out that API-breaking changes need to go in a next _.X._ semantic version release, (2.3.0), so I'd assume that applies here too.

@wy-z
Copy link
Contributor Author

wy-z commented Dec 12, 2016

They're now:

GetFoo(map[string]interface{}{
        "id": 6,
        "name: "foo",
})

~

@wing328
Copy link
Contributor

wing328 commented Dec 12, 2016

Yes, this is a breaking change and it should file against 2.3.0 branch instead.

@wy-z
Copy link
Contributor Author

wy-z commented Dec 12, 2016

ok~

@wy-z wy-z closed this Dec 16, 2016
@wy-z wy-z deleted the go_optimize_model_and_api_tmpl branch January 4, 2017 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants