Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Cookies are wrongly formatted #1404

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /