-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInt64SchemaRepresentable.swift
More file actions
47 lines (42 loc) · 1.15 KB
/
Int64SchemaRepresentable.swift
File metadata and controls
47 lines (42 loc) · 1.15 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
//
// Int64SchemaRepresentable.swift
// feather-openapi
//
// Created by Tibor Bödecs on 2026. 01. 22..
//
import OpenAPIKit30
/// Schema representation for 64-bit integer values.
public protocol Int64SchemaRepresentable:
SchemaRepresentable,
ExampleProperty,
DefaultValueProperty,
AllowedValuesProperty
where
ExamplePropertyType == Int64,
DefaultValuePropertyType == Int64,
AllowedValuesPropertyType == Int64
{
}
extension Int64SchemaRepresentable {
/// Builds an int64 JSON schema.
/// - Returns: The JSON schema.
public func openAPISchema() -> JSONSchema {
.integer(
format: .int64,
required: `required`,
nullable: nullable,
permissions: nil,
deprecated: deprecated,
title: title,
description: description,
discriminator: nil,
externalDocs: nil,
multipleOf: nil,
maximum: nil,
minimum: nil,
allowedValues: allowedValues?.map { .init($0) },
defaultValue: defaultValue.map { .init($0) },
example: example.map { .init($0) }
)
}
}