utrack / clay

Proto-first minimal server platform for gRPС+REST+Swagger APIs
MIT License
290 stars 37 forks source link

Apply a configurable swagger option #68

Closed NOMORECOFFEE closed 5 years ago

NOMORECOFFEE commented 5 years ago

I think these options (d.opts.SwaggerDefaultOpts) should be present in this condition

If a service isConfigurableServiceDesc, we can append additional swagger option but not check it

utrack commented 5 years ago

What do you mean by checking them? What should we check for @ that if?

NOMORECOFFEE commented 5 years ago
if len(options) > 0 || len(d.opts.SwaggerDefaultOpts) > 0 {
...
}
NOMORECOFFEE commented 5 years ago

test case

var s interface{ConfigurableServiceDesc; ServiceDesc} = ...
s.Apply(WithSwaggerOptions(removeSwaggeSpec)) // or change Version
spec := s.SwaggerDef() // wait changes ☝️
utrack commented 5 years ago

Thanks!