As you can see the embedded pointer struct gets documented, as well as the header seperately. Even when hidden is true, and json is "-".
I can define the headers in my schema definition instead so that they could be reused across endpoints.. but I still need to be able to write the headers to the response anyway (which I need a struct for)? and since huma.register takes a context.Context rather than the huma.Context I'm struggling to see any way to write headers and have them documented correctly other than to duplicate the headers everywhere?
EDIT:
Have determined it works as expected IF the struct is embedded directly, instead of a pointer.
So i'm trying to get my head around how I can utilise common headers in all my responses. I tried the following
This outputs the following in the docs:
As you can see the embedded pointer struct gets documented, as well as the header seperately. Even when hidden is true, and json is "-".
I can define the headers in my schema definition instead so that they could be reused across endpoints.. but I still need to be able to write the headers to the response anyway (which I need a struct for)? and since huma.register takes a context.Context rather than the huma.Context I'm struggling to see any way to write headers and have them documented correctly other than to duplicate the headers everywhere?
EDIT: Have determined it works as expected IF the struct is embedded directly, instead of a pointer.