Skip to content

Conversation

czechboy0
Copy link
Contributor

Motivation

The generator piece of apple/swift-openapi-runtime#113.

This is needed for APIs such as Kubernetes, that has both application/json and application/json; watch=true in a single operation.

Currently the parameters weren't taken into account, which could lead to incorrect matching of content types.

Modifications

Use the full MIME type, including the parameters, for matching.

Result

More correct behavior, now we correctly handle multiple MIME types with the same type/subtype in an operation.

Test Plan

Added a unit test.

Copy link
Collaborator

@simonjbeaumont simonjbeaumont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome—thanks @czechboy0!

@czechboy0 czechboy0 enabled auto-merge (squash) November 28, 2024 13:27
@czechboy0 czechboy0 added 🔨 semver/patch No public API change. and removed 🔨 semver/patch No public API change. labels Nov 28, 2024
@czechboy0 czechboy0 disabled auto-merge November 28, 2024 14:35
@czechboy0 czechboy0 merged commit cdc23b5 into apple:main Nov 28, 2024
36 checks passed
@czechboy0 czechboy0 deleted the hd-mime-type-params branch November 28, 2024 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 semver/patch No public API change.

2 participants