-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContentRepresentable.swift
More file actions
39 lines (34 loc) · 942 Bytes
/
ContentRepresentable.swift
File metadata and controls
39 lines (34 loc) · 942 Bytes
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
//
// ContentRepresentable.swift
// feather-openapi
//
// Created by Tibor Bödecs on 2026. 01. 23.
//
import OpenAPIKit30
/// Describes OpenAPI content with a schema.
public protocol ContentRepresentable:
OpenAPIContentRepresentable,
ReferencedSchemaMapRepresentable,
VendorExtensionsProperty
{
/// The schema for the content.
var schema: SchemaRepresentable { get }
}
extension ContentRepresentable {
/// Builds an OpenAPI content object.
/// - Returns: The OpenAPI content.
public func openAPIContent() -> OpenAPI.Content {
.init(
schema: schema.openAPISchema(),
examples: nil,
encoding: nil,
vendorExtensions: vendorExtensions
)
}
/// Referenced schemas for this content.
public var referencedSchemaMap:
OrderedDictionary<SchemaID, OpenAPISchemaRepresentable>
{
schema.allReferencedSchemaMap()
}
}