Skip to content

feat(openapi): support cookie parameters (in: cookie)#586

Closed
KrisSimon wants to merge 2 commits intomainfrom
migrate-stub-pr
Closed

feat(openapi): support cookie parameters (in: cookie)#586
KrisSimon wants to merge 2 commits intomainfrom
migrate-stub-pr

Conversation

@KrisSimon
Copy link
Copy Markdown
Member

Migrated from GitLab MR !190 (merged)
feature/openapi-194main
Originally created: 2026-03-21
Merged: 2026-03-25
Author: Kris Simon
Labels: openapi

Closes #194

Parses the Cookie request header and exposes declared cookie parameters as cookieParameters in the execution context. Feature sets can use:

Extract the <session-id> from the <cookieParameters: session-id>.

Changes

  • SchemaBinding.swift: Added parseCookieHeader(_:) free function (splits name=value; ..., URL-decodes values) and OpenAPIContextBinder.bindCookieParameters(_:) (creates cookieParameters dict + individual cookieParameters.{name} keys, matching the pattern used for path/query/header parameters)
  • OpenAPIHTTPHandler.swift: Parses the Cookie header, filters to only in: cookie declared parameters, validates required cookies (HTTP 400 if missing), and carries cookieParameters on HTTPOperationEvent
  • Application.swift: Extracts declared cookie parameters from the request and binds them to the execution context as cookieParameters

Tests

  • parseCookieHeader: single cookie, multiple cookies, empty string, percent-encoded values, base64 values with =, malformed pairs, whitespace trimming
  • bindCookieParameters: dict creation, individual key creation, empty input
  • Required cookie validation: missing required → 400, present required → not 400, optional missing → not 400, no required field → not 400, JSON error body shape

@KrisSimon KrisSimon closed this Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant