From 178abccb6f28dbf8352303b8e3c381c73d1120a3 Mon Sep 17 00:00:00 2001 From: Mikail Bagishov Date: Tue, 14 Jul 2020 15:46:53 +0300 Subject: [PATCH 1/2] Support binary file uploads --- src/v2/codegen/emitter.rs | 1 + tests/pet-v2.yaml | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/src/v2/codegen/emitter.rs b/src/v2/codegen/emitter.rs index 1db38bd25..8755fdfa7 100644 --- a/src/v2/codegen/emitter.rs +++ b/src/v2/codegen/emitter.rs @@ -1205,6 +1205,7 @@ fn matching_unit_type( Some(DataTypeFormat::Int64) => Some("i64"), Some(DataTypeFormat::Float) => Some("f32"), Some(DataTypeFormat::Double) => Some("f64"), + Some(DataTypeFormat::Binary) => Some("Vec"), _ => match type_ { Some(DataType::Integer) => Some("i64"), Some(DataType::Number) => Some("f64"), diff --git a/tests/pet-v2.yaml b/tests/pet-v2.yaml index f432c1b17..3a550d319 100644 --- a/tests/pet-v2.yaml +++ b/tests/pet-v2.yaml @@ -362,6 +362,14 @@ paths: type: array items: type: integer + /test/upload: + put: + requestBody: + content: + image/png: + schema: + type: string + format: binary responses: '200': $ref: '#/responses/StatusResponse' From e3a2a23e77ceda00772ee2df67d4cc74def29274 Mon Sep 17 00:00:00 2001 From: Mikail Bagishov Date: Sat, 25 Jul 2020 23:55:53 +0300 Subject: [PATCH 2/2] fix --- tests/pet-v2.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/pet-v2.yaml b/tests/pet-v2.yaml index 3a550d319..010b8a138 100644 --- a/tests/pet-v2.yaml +++ b/tests/pet-v2.yaml @@ -362,6 +362,9 @@ paths: type: array items: type: integer + responses: + '200': + $ref: '#/responses/StatusResponse' /test/upload: put: requestBody: