We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 22a8ca4 commit 1628584Copy full SHA for 1628584
1 file changed
Sources/FeatherOpenAPIKit/Interfaces/RequestBody/FormBody.swift
@@ -0,0 +1,28 @@
1
+//
2
+// File.swift
3
4
+// Created by gerp83 on 28/08/2024
5
6
+
7
+import OpenAPIKit
8
9
+public protocol FormBody: RequestBody {
10
+ static var description: String { get }
11
+ static var schema: Schema.Type { get }
12
+ static var required: Bool { get }
13
+}
14
15
+public extension FormBody {
16
17
+ static var required: Bool { true }
18
19
+ static func openAPIRequestBody() -> OpenAPI.Request {
20
+ .init(
21
+ description: description,
22
+ content: [
23
+ .form: schema.reference()
24
+ ],
25
+ required: required
26
+ )
27
+ }
28
0 commit comments