This repository has been archived by the owner on Oct 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #363 from Azure/feature/allow-binary-file-with-jso…
…n-content-type Allow binary files with json content type
- Loading branch information
Showing
7 changed files
with
637 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
110 changes: 110 additions & 0 deletions
110
modelerfour/test/scenarios/body-binary-json/flattened.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
!<!CodeModel> | ||
info: !<!Info> | ||
description: Acceptance test for file with json content type. | ||
title: 'Binary with content-type: application/json' | ||
schemas: !<!Schemas> | ||
strings: | ||
- !<!StringSchema> &ref_0 | ||
type: string | ||
language: !<!Languages> | ||
default: | ||
name: string | ||
description: simple string | ||
protocol: !<!Protocols> {} | ||
binaries: | ||
- !<!BinarySchema> &ref_2 | ||
type: binary | ||
apiVersions: | ||
- !<!ApiVersion> | ||
version: 1.0.0 | ||
language: !<!Languages> | ||
default: | ||
name: binary | ||
description: '' | ||
protocol: !<!Protocols> {} | ||
globalParameters: | ||
- !<!Parameter> &ref_1 | ||
schema: *ref_0 | ||
clientDefaultValue: 'https://localhost' | ||
implementation: Client | ||
origin: 'modelerfour:synthesized/host' | ||
required: true | ||
extensions: | ||
x-ms-skip-url-encoding: true | ||
language: !<!Languages> | ||
default: | ||
name: $host | ||
description: server parameter | ||
serializedName: $host | ||
protocol: !<!Protocols> | ||
http: !<!HttpParameter> | ||
in: uri | ||
operationGroups: | ||
- !<!OperationGroup> | ||
$key: Upload | ||
operations: | ||
- !<!Operation> | ||
apiVersions: | ||
- !<!ApiVersion> | ||
version: 1.0.0 | ||
parameters: | ||
- *ref_1 | ||
requests: | ||
- !<!Request> | ||
parameters: | ||
- !<!Parameter> &ref_3 | ||
schema: *ref_2 | ||
implementation: Method | ||
required: true | ||
language: !<!Languages> | ||
default: | ||
name: fileParam | ||
description: Foo bar | ||
protocol: !<!Protocols> | ||
http: !<!HttpParameter> | ||
in: body | ||
style: binary | ||
signatureParameters: | ||
- *ref_3 | ||
language: !<!Languages> | ||
default: | ||
name: '' | ||
description: '' | ||
protocol: !<!Protocols> | ||
http: !<!HttpBinaryRequest> | ||
path: /file | ||
method: post | ||
binary: true | ||
knownMediaType: binary | ||
mediaTypes: | ||
- application/json | ||
uri: '{$host}' | ||
signatureParameters: [] | ||
responses: | ||
- !<!Response> | ||
language: !<!Languages> | ||
default: | ||
name: '' | ||
description: '' | ||
protocol: !<!Protocols> | ||
http: !<!HttpResponse> | ||
statusCodes: | ||
- '200' | ||
language: !<!Languages> | ||
default: | ||
name: File | ||
description: Uploading json file | ||
protocol: !<!Protocols> {} | ||
language: !<!Languages> | ||
default: | ||
name: Upload | ||
description: '' | ||
protocol: !<!Protocols> {} | ||
security: !<!Security> | ||
authenticationRequired: false | ||
language: !<!Languages> | ||
default: | ||
name: '' | ||
description: '' | ||
protocol: !<!Protocols> | ||
http: !<!HttpModel> {} |
110 changes: 110 additions & 0 deletions
110
modelerfour/test/scenarios/body-binary-json/grouped.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
!<!CodeModel> | ||
info: !<!Info> | ||
description: Acceptance test for file with json content type. | ||
title: 'Binary with content-type: application/json' | ||
schemas: !<!Schemas> | ||
strings: | ||
- !<!StringSchema> &ref_0 | ||
type: string | ||
language: !<!Languages> | ||
default: | ||
name: string | ||
description: simple string | ||
protocol: !<!Protocols> {} | ||
binaries: | ||
- !<!BinarySchema> &ref_2 | ||
type: binary | ||
apiVersions: | ||
- !<!ApiVersion> | ||
version: 1.0.0 | ||
language: !<!Languages> | ||
default: | ||
name: binary | ||
description: '' | ||
protocol: !<!Protocols> {} | ||
globalParameters: | ||
- !<!Parameter> &ref_1 | ||
schema: *ref_0 | ||
clientDefaultValue: 'https://localhost' | ||
implementation: Client | ||
origin: 'modelerfour:synthesized/host' | ||
required: true | ||
extensions: | ||
x-ms-skip-url-encoding: true | ||
language: !<!Languages> | ||
default: | ||
name: $host | ||
description: server parameter | ||
serializedName: $host | ||
protocol: !<!Protocols> | ||
http: !<!HttpParameter> | ||
in: uri | ||
operationGroups: | ||
- !<!OperationGroup> | ||
$key: Upload | ||
operations: | ||
- !<!Operation> | ||
apiVersions: | ||
- !<!ApiVersion> | ||
version: 1.0.0 | ||
parameters: | ||
- *ref_1 | ||
requests: | ||
- !<!Request> | ||
parameters: | ||
- !<!Parameter> &ref_3 | ||
schema: *ref_2 | ||
implementation: Method | ||
required: true | ||
language: !<!Languages> | ||
default: | ||
name: fileParam | ||
description: Foo bar | ||
protocol: !<!Protocols> | ||
http: !<!HttpParameter> | ||
in: body | ||
style: binary | ||
signatureParameters: | ||
- *ref_3 | ||
language: !<!Languages> | ||
default: | ||
name: '' | ||
description: '' | ||
protocol: !<!Protocols> | ||
http: !<!HttpBinaryRequest> | ||
path: /file | ||
method: post | ||
binary: true | ||
knownMediaType: binary | ||
mediaTypes: | ||
- application/json | ||
uri: '{$host}' | ||
signatureParameters: [] | ||
responses: | ||
- !<!Response> | ||
language: !<!Languages> | ||
default: | ||
name: '' | ||
description: '' | ||
protocol: !<!Protocols> | ||
http: !<!HttpResponse> | ||
statusCodes: | ||
- '200' | ||
language: !<!Languages> | ||
default: | ||
name: File | ||
description: Uploading json file | ||
protocol: !<!Protocols> {} | ||
language: !<!Languages> | ||
default: | ||
name: Upload | ||
description: '' | ||
protocol: !<!Protocols> {} | ||
security: !<!Security> | ||
authenticationRequired: false | ||
language: !<!Languages> | ||
default: | ||
name: '' | ||
description: '' | ||
protocol: !<!Protocols> | ||
http: !<!HttpModel> {} |
110 changes: 110 additions & 0 deletions
110
modelerfour/test/scenarios/body-binary-json/modeler.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
!<!CodeModel> | ||
info: !<!Info> | ||
description: Acceptance test for file with json content type. | ||
title: 'Binary with content-type: application/json' | ||
schemas: !<!Schemas> | ||
strings: | ||
- !<!StringSchema> &ref_0 | ||
type: string | ||
language: !<!Languages> | ||
default: | ||
name: string | ||
description: simple string | ||
protocol: !<!Protocols> {} | ||
binaries: | ||
- !<!BinarySchema> &ref_1 | ||
type: binary | ||
apiVersions: | ||
- !<!ApiVersion> | ||
version: 1.0.0 | ||
language: !<!Languages> | ||
default: | ||
name: binary | ||
description: '' | ||
protocol: !<!Protocols> {} | ||
globalParameters: | ||
- !<!Parameter> &ref_3 | ||
schema: *ref_0 | ||
clientDefaultValue: 'https://localhost' | ||
implementation: Client | ||
origin: 'modelerfour:synthesized/host' | ||
required: true | ||
extensions: | ||
x-ms-skip-url-encoding: true | ||
language: !<!Languages> | ||
default: | ||
name: $host | ||
description: server parameter | ||
serializedName: $host | ||
protocol: !<!Protocols> | ||
http: !<!HttpParameter> | ||
in: uri | ||
operationGroups: | ||
- !<!OperationGroup> | ||
$key: Upload | ||
operations: | ||
- !<!Operation> | ||
apiVersions: | ||
- !<!ApiVersion> | ||
version: 1.0.0 | ||
parameters: | ||
- *ref_3 | ||
requests: | ||
- !<!Request> | ||
parameters: | ||
- !<!Parameter> &ref_2 | ||
schema: *ref_1 | ||
implementation: Method | ||
required: true | ||
language: !<!Languages> | ||
default: | ||
name: fileParam | ||
description: Foo bar | ||
protocol: !<!Protocols> | ||
http: !<!HttpParameter> | ||
in: body | ||
style: binary | ||
signatureParameters: | ||
- *ref_2 | ||
language: !<!Languages> | ||
default: | ||
name: '' | ||
description: '' | ||
protocol: !<!Protocols> | ||
http: !<!HttpBinaryRequest> | ||
path: /file | ||
method: post | ||
binary: true | ||
knownMediaType: binary | ||
mediaTypes: | ||
- application/json | ||
uri: '{$host}' | ||
signatureParameters: [] | ||
responses: | ||
- !<!Response> | ||
language: !<!Languages> | ||
default: | ||
name: '' | ||
description: '' | ||
protocol: !<!Protocols> | ||
http: !<!HttpResponse> | ||
statusCodes: | ||
- '200' | ||
language: !<!Languages> | ||
default: | ||
name: File | ||
description: Uploading json file | ||
protocol: !<!Protocols> {} | ||
language: !<!Languages> | ||
default: | ||
name: Upload | ||
description: '' | ||
protocol: !<!Protocols> {} | ||
security: !<!Security> | ||
authenticationRequired: false | ||
language: !<!Languages> | ||
default: | ||
name: '' | ||
description: '' | ||
protocol: !<!Protocols> | ||
http: !<!HttpModel> {} |
Oops, something went wrong.