openapi-generator icon indicating copy to clipboard operation
openapi-generator copied to clipboard

[REQ] Cookie parameters are not annotated as such in typescript

Open orcharddweller opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe.

I'm not sure if I'm missing some kind of config, but currently, when I generate an axios typescript sdk, it shows cookie parameters as if they were no different from the rest. Because of that, when using the SDK I have to go back to the original docs to figure out which ones were cookies (it's not always obvious from the name).

Describe the solution you'd like

I'd like the generated docstrings to contain a "cookie" annotation for each cookie parameter.

Describe alternatives you've considered

Naming all cookies as something_cookie, but it doesn't work if the cookie is already named in some other context by an external tool, and makes the names unnecessarily verbose.

orcharddweller avatar Jun 28 '22 14:06 orcharddweller

in my opinion the problem here is that cookies are not handled as implicit parameters (like headers are, see implementation for instance in org.openapitools.codegen.languages.AbstractJavaCodegen#handleImplicitHeaders).

To make it clear: I don't want to pass the cookie as parameter to the typescript stubs as it is already passed as cookie by the browser.

So I would expect that cookie parameters are not added to the Typescript interfaces at all. The interface docs could describe the cookie param.

abentele avatar Jun 02 '25 06:06 abentele