ETagged integration with ETag header definition in response struct #142
Replies: 3 comments 1 reply
-
Can you explain your scenario in more details? Why do you need re BTW: canonical has different definition as per Go implementation, first char and every first char after |
Beta Was this translation helpful? Give feedback.
-
One can define "default"
"BTW" was about HTTP header name (which should be canonical HTTP |
Beta Was this translation helpful? Give feedback.
-
Thanks for explanation. So it's better to use |
Beta Was this translation helpful? Give feedback.
-
When using ETagged to populate
ETag
header, one cannot defineETag
in response struct because value from struct overrides one generated withETagged
.Using
ETag
header definition in response struct allows one to make it present in openapi.json, to make it required header, validate response with it, etc.;ETagged
doesn't allow it.Consider integrating
ETagged
solution withETag
header definition in response struct: when both are defined andETag
header value in response struct is empty, use value generated withETagged
but validate it against format defined in response struct forETag
response header; ifETag
header value is non-empty in response struct - validate it and use it instead ofETagged
value.BTW: canonical
ETag
header name should be used in https://github.com/swaggest/rest/blob/master/response/encoder.go#L319 probably.Beta Was this translation helpful? Give feedback.
All reactions