-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathInformation.swift
More file actions
43 lines (33 loc) · 1.27 KB
/
Information.swift
File metadata and controls
43 lines (33 loc) · 1.27 KB
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
public struct Information {
/// The title of the application.
public let title: String
/// A short description of the application.
public let description: String?
/// The Terms of Service for the API.
public let termsOfService: String?
/// The contact information for the exposed API.
public let contact: Contact?
/// The license information for the exposed API.
public let license: License?
/// Provides the version of the application API (not to be confused with the specification version).
public let version: Version
}
struct InformationBuilder: Codable {
let title: String
let description: String?
let termsOfService: String?
let contact: ContactBuilder?
let license: LicenseBuilder?
let version: Version
}
extension InformationBuilder: Builder {
typealias Building = Information
func build(_ swagger: SwaggerBuilder) throws -> Information {
return Information(title: self.title,
description: self.description,
termsOfService: self.termsOfService,
contact: try self.contact?.build(swagger),
license: try self.license?.build(swagger),
version: self.version)
}
}