-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExampleModel+Operations.swift
More file actions
42 lines (38 loc) · 1.15 KB
/
ExampleModel+Operations.swift
File metadata and controls
42 lines (38 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
//
// ExampleModel+Operations.swift
// feather-openapi
//
// Created by Tibor Bödecs on 2026. 01. 25..
import FeatherOpenAPI
import OpenAPIKit30
extension Example.Model {
struct GetOperation: OperationRepresentable {
var tags: [TagRepresentable] { [ModelTag()] }
var summary: String? { "Detail example" }
var description: String? { "Detail example detail" }
var parameters: [ParameterRepresentable] {
[
IdParameter().reference(),
CustomRequestHeaderParameter().reference(),
]
}
var responseMap: ResponseMap {
[
200: DetailResponse().reference()
]
}
}
struct CreateOperation: OperationRepresentable {
var tags: [TagRepresentable] { [ModelTag()] }
var summary: String? { "Create example" }
var description: String? { "Create example detail" }
var requestBody: RequestBodyRepresentable? {
CreateRequestBody().reference()
}
var responseMap: ResponseMap {
[
200: DetailResponse().reference()
]
}
}
}