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.
Uh oh!
There was an error while loading. Please reload this page.
-
When using ETagged to populate
ETagheader, one cannot defineETagin response struct because value from struct overrides one generated withETagged.Using
ETagheader definition in response struct allows one to make it present in openapi.json, to make it required header, validate response with it, etc.;ETaggeddoesn't allow it.Consider integrating
ETaggedsolution withETagheader definition in response struct: when both are defined andETagheader value in response struct is empty, use value generated withETaggedbut validate it against format defined in response struct forETagresponse header; ifETagheader value is non-empty in response struct - validate it and use it instead ofETaggedvalue.BTW: canonical
ETagheader 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