-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathComponents.swift
More file actions
69 lines (65 loc) · 2.63 KB
/
Copy pathComponents.swift
File metadata and controls
69 lines (65 loc) · 2.63 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//
// Components.swift
// feather-openapi
//
// Created by Tibor Bödecs on 2026. 01. 23.
//
import OpenAPIKit30
/// Concrete container for reusable OpenAPI components.
public struct Components: ComponentsRepresentable {
/// Schema component map.
public var schemas: OrderedDictionary<SchemaID, OpenAPISchemaRepresentable>
/// Parameter component map.
public var parameters:
OrderedDictionary<ParameterID, OpenAPIParameterRepresentable>
/// Example component map.
public var examples:
OrderedDictionary<ExampleID, OpenAPIExampleRepresentable>
/// Response component map.
public var responses:
OrderedDictionary<ResponseID, OpenAPIResponseRepresentable>
/// Request body component map.
public var requestBodies:
OrderedDictionary<RequestBodyID, OpenAPIRequestBodyRepresentable>
/// Header component map.
public var headers: OrderedDictionary<HeaderID, OpenAPIHeaderRepresentable>
/// Security requirement list used by components.
public var securityRequirements: [SecurityRequirementRepresentable]
/// Link component map.
public var links: OrderedDictionary<LinkID, OpenAPILinkRepresentable>
/// Creates a components container.
/// - Parameters:
/// - schemas: Schema component map.
/// - parameters: Parameter component map.
/// - examples: Example component map.
/// - responses: Response component map.
/// - requestBodies: Request body component map.
/// - headers: Header component map.
/// - securityRequirements: Security requirements.
/// - links: Link component map.
public init(
schemas: OrderedDictionary<SchemaID, OpenAPISchemaRepresentable> = [:],
parameters: OrderedDictionary<
ParameterID, OpenAPIParameterRepresentable
> = [:],
examples: OrderedDictionary<ExampleID, OpenAPIExampleRepresentable> =
[:],
responses: OrderedDictionary<ResponseID, OpenAPIResponseRepresentable> =
[:],
requestBodies: OrderedDictionary<
RequestBodyID, OpenAPIRequestBodyRepresentable
> = [:],
headers: OrderedDictionary<HeaderID, OpenAPIHeaderRepresentable> = [:],
securityRequirements: [SecurityRequirementRepresentable] = [],
links: OrderedDictionary<LinkID, OpenAPILinkRepresentable> = [:],
) {
self.schemas = schemas
self.parameters = parameters
self.examples = examples
self.responses = responses
self.requestBodies = requestBodies
self.headers = headers
self.securityRequirements = securityRequirements
self.links = links
}
}