Replies: 2 comments
-
|
Further digging lead me to next discoveries: to change Input content type and get this documentation: you need to specify contentType as struct tag, not header Right way: Wrong way: For Output content type the only way I've found is specifying Response on Operation level (instead of in Output struct) - which looks cumbersome to me, but does the thing. Example: generates documentation This also magically changes Accept header used in docs (Stoplight UI) under the hood. However after all this manipulations my content negotiation is broken despite sending correct headers and having all required formats in Huma config: So I still can't use my custom content type consistently and get correct documentation. |
Beta Was this translation helpful? Give feedback.
-
|
Couldn't resolve content negotiation problem, had to create an issue - #833 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
My application uses "application/vnd.api+json" Content-Type, so I've specified this in huma Config accordingly:
I've also added
to my Input and Output structs.
And couldn't find an Operation level way to specify Content-Type.
However, in generated documentation I always get:
as well in UI "application/json" and ONLY "application/json" is offered in Body dropdown and selected by default, which results in HTTP 415 Unsupported Media Type.
Is there a way to override this? Is it hardcoded in Stoplight Elements?
Beta Was this translation helpful? Give feedback.
All reactions