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

Add definition for application/json-seq #2740

Merged
merged 2 commits into from
Nov 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
61 changes: 35 additions & 26 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,7 @@ name: test
on: { pull_request: {} }

jobs:
getcidata:
runs-on: ubuntu-latest
outputs:
environments: ${{ steps.output.outputs.environments }}
steps:
- id: output
run: |
envblob="$(curl -fsSL https://raw.githubusercontent.com/vapor/ci/main/pr-environments.json | jq -cMj '.')"
echo "::set-output name=environments::${envblob}"

test-providers:
needs: getcidata
strategy:
fail-fast: false
matrix:
Expand All @@ -40,28 +29,48 @@ jobs:
- name: Run tests with Thread Sanitizer
run: swift test --sanitize=thread
working-directory: provider

test-vapor:
needs: getcidata

test-vapor-linux:
strategy:
fail-fast: false
matrix:
env: ${{ fromJSON(needs.getcidata.outputs.environments) }}
runs-on: ${{ matrix.env.os }}
container: ${{ matrix.env.image }}
image:
- swift:5.2-focal
- swift:5.3-focal
- swift:5.4-focal
- swift:5.5-focal
runs-on: ubuntu-latest
container: ${{ matrix.image }}
steps:
- name: Check out Vapor
uses: actions/checkout@v2
- name: Run main tests with Thread Sanitizer
run: swift test --enable-test-discovery --filter '^VaporTests' --sanitize=thread
- name: Run async tests without Thread Sanitizer
# TSAN and async don't play nice at the moment
run: swift test --enable-test-discovery --filter '^AsyncTests'

test-vapor-macos:
strategy:
fail-fast: false
matrix:
xcode:
- latest
- latest-stable
runs-on: macos-11
steps:
- name: Select toolchain
uses: maxim-lobanov/setup-xcode@v1.2.1
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.env.toolchain }}
if: ${{ matrix.env.toolchain != '' }}
xcode-version: ${{ matrix.xcode }}
- name: Check out Vapor
uses: actions/checkout@v2
- name: Run main tests with Thread Sanitizer
timeout-minutes: 30
run: swift test --enable-test-discovery --filter VaporTests --sanitize=thread
run: |
swift test --filter '^VaporTests' --sanitize=thread -Xlinker -rpath \
-Xlinker $(xcode-select -p)/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.5/macosx
- name: Run async tests without Thread Sanitizer
# TSAN and async aren't playing nice at the moment
timeout-minutes: 30
if: ${{ matrix.env.toolchain == '' }}
run: swift test --enable-test-discovery --filter AsyncTests
# TSAN and async don't play nice at the moment
run: |
swift test --filter '^AsyncTests' -Xlinker -rpath \
-Xlinker $(xcode-select -p)/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.5/macosx
2 changes: 1 addition & 1 deletion Sources/Vapor/HTTP/Headers/HTTPHeaders.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ extension HTTPHeaders {

/// Returns a collection of `MediaTypePreference`s specified by this HTTP message's `"Accept"` header.
///
/// You can returns all `MediaType`s in this collection to check membership.
/// You can access all `MediaType`s in this collection to check membership.
///
/// httpReq.accept.mediaTypes.contains(.html)
///
Expand Down
8 changes: 7 additions & 1 deletion Sources/Vapor/HTTP/Headers/HTTPMediaType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,14 @@ public extension HTTPMediaType {
static let multipart = HTTPMediaType(type: "multipart", subType: "mixed")
/// JSON media type.
static let json = HTTPMediaType(type: "application", subType: "json", parameters: ["charset": "utf-8"])
/// JSON API media type (see https://jsonapi.org/format/).
/// JSON API media type.
///
/// > Note: [JSON API specification](https://jsonapi.org/format/)
static let jsonAPI = HTTPMediaType(type: "application", subType: "vnd.api+json", parameters: ["charset": "utf-8"])
/// JSON sequence media type.
///
/// > Note: [JSON Text Sequence RFC](https://datatracker.ietf.org/doc/html/rfc7464)
static let jsonSequence = HTTPMediaType(type: "application", subType: "json-seq", parameters: ["charset": "utf-8"])
/// XML media type.
static let xml = HTTPMediaType(type: "application", subType: "xml", parameters: ["charset": "utf-8"])
/// DTD media type.
Expand Down