forked from apple/swift-openapi-runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathURICoderConfiguration.swift
61 lines (48 loc) · 1.89 KB
/
URICoderConfiguration.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftOpenAPIGenerator open source project
//
// Copyright (c) 2023 Apple Inc. and the SwiftOpenAPIGenerator project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftOpenAPIGenerator project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import Foundation
/// A bag of configuration values used by the URI encoder and decoder.
struct URICoderConfiguration {
/// A variable expansion style as described by RFC 6570 and OpenAPI 3.0.4.
enum Style {
/// A style for simple string variable expansion.
///
/// The whole string always belongs to the root key.
case simple
/// A style for form-based URI expansion.
///
/// Only some key/value pairs can belong to the root key, rest are ignored.
case form
/// A style for nested variable expansion
///
/// Only some key/value pairs can belong to the root key, rest are ignored.
case deepObject
}
/// A character used to escape the space character.
enum SpaceEscapingCharacter: String {
/// A percent encoded value for the space character.
case percentEncoded = "%20"
/// The plus character.
case plus = "+"
}
/// The variable expansion style.
var style: Style
/// A Boolean value indicating whether the key should be repeated with
/// each value, as described by RFC 6570 and OpenAPI 3.0.4.
var explode: Bool
/// The character used to escape the space character.
var spaceEscapingCharacter: SpaceEscapingCharacter
/// The coder used for serializing the Date type.
var dateTranscoder: any DateTranscoder
}