@@ -31,19 +31,21 @@ import (
3131// https://swagger.io/docs/specification/serialization/
3232// It is a backward compatible function to clients generated with codegen
3333// up to version v1.5.5. v1.5.6+ calls the function below.
34- func BindStyledParameter (style string , explode bool , paramName string ,
34+ func BindStyledParameter (style string , explode bool , required bool , paramName string ,
3535 value string , dest interface {}) error {
36- return BindStyledParameterWithLocation (style , explode , paramName , ParamLocationUndefined , value , dest )
36+ return BindStyledParameterWithLocation (style , explode , required , paramName , ParamLocationUndefined , value , dest )
3737}
3838
3939// BindStyledParameterWithLocation binds a parameter as described in the Path Parameters
4040// section here to a Go object:
4141// https://swagger.io/docs/specification/serialization/
42- func BindStyledParameterWithLocation (style string , explode bool , paramName string ,
42+ func BindStyledParameterWithLocation (style string , explode bool , required bool , paramName string ,
4343 paramLocation ParamLocation , value string , dest interface {}) error {
4444
45- if value == "" {
46- return fmt .Errorf ("parameter '%s' is empty, can't bind its value" , paramName )
45+ if required {
46+ if value == "" {
47+ return fmt .Errorf ("parameter '%s' is empty, can't bind its value" , paramName )
48+ }
4749 }
4850
4951 // Based on the location of the parameter, we need to unescape it properly.
0 commit comments