-
-
Notifications
You must be signed in to change notification settings - Fork 263
Open
@ckeiner
Description
Describe the bug
Cookies are usually defined as key value pairs that follow a syntax as described by the MDN spec. However, generating code with the python generator for openapi-generator formats cookies in a different manner, mainly without the equal sign. This is also written in the auto-generated Configuration.py:
conf = openapi_client.Configuration(
api_key={'cookieAuth': 'abc123'}
api_key_prefix={'cookieAuth': 'JSESSIONID'}
)
The following cookie will be added to the HTTP request:
Cookie: JSESSIONID abc123
I assume this must be a bug since this does not follow the official MDN spec. If not, it might make sense to adjust the auto-generated comments since it is very easy to miss this issue.
OpenAPI Spec File
Unfortunately, I'm missing a non-local server to give a generic file but this should be a valid file for a generic health endpoint
/health: get: summary: Get health by authorizing with a cookie description: Get health by authorizing with a cookie operationId: getProtectedPage security: - CookieAuth: [] responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/HealthResponse" components: securitySchemes: CookieAuth: type: apiKey in: cookie name: accessToken schema: HealthResponse: properties: health: type: string example: "OK"
Desktop (please complete the following information):
- OS: Windows 11; WSL 2.0 with Ubuntu
- Python Version: 3.12.3
- openapi-generator-cli 7.19.0
- openapi-python-client version: (not sure which version the cli tool uses)
Metadata
Metadata
Assignees
Labels
No labels