Closed pboguslawski closed 1 year ago
There is another problem in your example, required:"true"
is an ineffective constraint once case sensitivity is solved.
required
is checked against the presence of a key in an object, and string
will always have at least ""
zero value (as a header Etag:
). You can use omitempty
to convert zero value to key absence.
ETag string `header:"ETag,omitempty" json:"-" required:"true"`
Or use minLength:"1"
instead of required:"true"
.
Thank you. Please tag code after fixes to allow auto updating dependencies.
Describe the bug Accrording to #119 header names should be compared in case insensitive fashion.
When ETag response header is defined with
ETag
canonical nameresponse validation error is thrown (missing etag header value) even if
ETag
field is populated in response struct. No such error when response struct is defined withEtag
header nameExpected behavior No response validation error thrown when
header:"ETag"
is used in struct definition.