Skip to content

Commit c272508

Browse files
authored
Extend for binary and byte data (#19)
1 parent f5098ec commit c272508

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

src/navi/transform.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
return a Malli schema that respects format, length constraints, pattern, and enum."
8989
[^Schema schema]
9090
(let [preds {"uuid" uuid?
91-
"binary" string?
91+
"binary" bytes?
9292
"byte" string?
9393
"date" inst?
9494
"date-time" inst?

test/api.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,15 @@ paths:
168168
description: "optional query name"
169169
required:
170170
- query
171+
"/raw":
172+
post:
173+
operationId: ProvideRawData
174+
requestBody:
175+
content:
176+
application/octet-stream:
177+
schema:
178+
type: string
179+
format: binary
171180

172181
components:
173182
schemas:

test/navi/core_test.clj

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"GetInclusiveIntervalInteger" identity
2121
"GetInclusiveIntervalNumber" identity
2222
"GetMinMaxNumber" identity
23-
"RunV2GraphQLQuery" identity})
23+
"RunV2GraphQLQuery" identity
24+
"ProvideRawData" identity})
2425
[["/get/{id}/and/{version}"
2526
{:get
2627
{:handler identity
@@ -111,4 +112,10 @@
111112
string?]
112113
[:operationName
113114
{:optional true}
114-
string?]]}}}]]))))
115+
string?]]}}}]
116+
["/raw"
117+
{:post
118+
{:handler identity
119+
:parameters
120+
{:body
121+
[:or nil? bytes?]}}}]]))))

0 commit comments

Comments
 (0)