Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up RFC 2045 “media type” in BodyStructure #717

Merged
merged 1 commit into from
Oct 6, 2022
Merged

Conversation

danieleggert
Copy link
Collaborator

Clean up RFC 2045 “media type” in BodyStructure.

Motivation:

Each “part” in a BodyStructure has an RFC 2045 “media type” — which is a combination of “top level type” + “sub-stype”.

But the types that were previously used, were inconsistently used / named. This PR cleans up the use of these and makes them consistent.

Additionally it adds a

extension BodyStructure {
    public var mediaType: Media.MediaType
}

such that it’s easy to get to a part’s media type, regardless of its kind.

Each “part” in a `BodyStructure` has an RFC 2045 “media type” — which is a combination of “top level type” + “sub-stype”.

But the types that were previously used, were inconsistently used / named. This PR cleans up the use of these and makes them consistent.

Additionally it adds a
```swift
extension BodyStructure {
    public var mediaType: Media.MediaType
}
```
such that it’s easy to get to a part’s media type, regardless of its kind.
@danieleggert danieleggert merged commit fc46347 into main Oct 6, 2022
@danieleggert danieleggert deleted the media-type branch October 6, 2022 13:49
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.

None yet

2 participants