Skip to content

Commit

Permalink
fix(openapi-sampler): sampling the binary data (#199)
Browse files Browse the repository at this point in the history
closes #198
  • Loading branch information
derevnjuk authored Feb 24, 2023
1 parent 507cf57 commit 84b25bc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/oas/tests/fixtures/petstore.oas.result.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
"bodySize": 0,
"postData": {
"mimeType": "multipart/form-data; boundary=956888039105887155673143",
"text": "--956888039105887155673143\r\nContent-Disposition: form-data; name=\"additionalMetadata\"\r\n\r\nlorem\r\n--956888039105887155673143\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n\\x01\\x02\\x03\\x04\\x05\r\n--956888039105887155673143--"
"text": "--956888039105887155673143\r\nContent-Disposition: form-data; name=\"additionalMetadata\"\r\n\r\nlorem\r\n--956888039105887155673143\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n\u0001\u0002\u0003\u0004\u0005\r\n--956888039105887155673143--"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion packages/openapi-sampler/src/samplers/StringSampler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class StringSampler implements Sampler {
'uri-reference': () => '../brokencrystals',
'uri-template': () => 'https://brokencrystals.com/api/file/{provider}',
'byte': () => 'ZHVtbXkgYmluYXJ5IHNhbXBsZQA=',
'binary': () => '\\x01\\x02\\x03\\x04\\x05',
'binary': () => '\x01\x02\x03\x04\x05',
'base64': () => 'ZHVtbXkgYmluYXJ5IHNhbXBsZQA=',
'uuid': () => 'fbdf5a53-161e-4460-98ad-0e39408d8689',
'json-pointer': () => '/json/pointer',
Expand Down
2 changes: 1 addition & 1 deletion packages/openapi-sampler/tests/string.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('StringSampler', () => {
type: 'string',
format: 'binary'
},
expected: '\\x01\\x02\\x03\\x04\\x05'
expected: '\x01\x02\x03\x04\x05'
},
{
input: {
Expand Down

0 comments on commit 84b25bc

Please sign in to comment.