Skip to content

Commit 68a2b68

Browse files
committed
feat: add response size to cli and json outputs
1 parent 66bfd56 commit 68a2b68

File tree

27 files changed

+86
-0
lines changed

27 files changed

+86
-0
lines changed

.changeset/fast-snakes-move.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@redocly/respect-core": minor
3+
"@redocly/cli": minor
4+
---
5+
6+
Added response size to the `Respect` terminal and JSON file outputs.

__tests__/respect/consider-severity-in-next-step-execution/__snapshots__/consider-severity-in-next-step-execution.test.ts.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ exports[`should not follow the default behavior to break and return if onFailure
1616
    Response status code: 200
1717
    Response time: <test> ms
1818
    Response Headers: <response headers test>
19+
    Response Size: <test> bytes
1920
    Response Body:
2021
      [
2122
       {
@@ -90,6 +91,7 @@ exports[`should not follow the default behavior to break and return if onFailure
9091
    Response status code: 200
9192
    Response time: <test> ms
9293
    Response Headers: <response headers test>
94+
    Response Size: <test> bytes
9395
    Response Body:
9496
      [
9597
       {
@@ -228,6 +230,7 @@ exports[`should not follow the default behavior to break and return if onFailure
228230
    Response status code: 200
229231
    Response time: <test> ms
230232
    Response Headers: <response headers test>
233+
    Response Size: <test> bytes
231234
    Response Body:
232235
      [
233236
       {

__tests__/respect/implicit/__snapshots__/implicit.test.ts.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ exports[`should implicitly add content type header based on requestBody.content
3232
    Response status code: 204
3333
    Response time: <test> ms
3434
    Response Headers: <response headers test>
35+
    Response Size: <test> bytes
3536
    Response Body:
3637
      {}
3738
@@ -67,6 +68,7 @@ exports[`should implicitly add content type header based on requestBody.content
6768
    Response status code: 400
6869
    Response time: <test> ms
6970
    Response Headers: <response headers test>
71+
    Response Size: <test> bytes
7072
    Response Body:
7173
      {
7274
       "type": "http://example.com",

__tests__/respect/inputs-passed-to-step-target-workflow-and-remapped/__snapshots__/inputs-passed-to-step-target-workflow-and-remapped.test.ts.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ exports[`should pass inputs to step target workflow with additional input parame
3535
    Response status code: 400
3636
    Response time: <test> ms
3737
    Response Headers: <response headers test>
38+
    Response Size: <test> bytes
3839
    Response Body:
3940
      {
4041
       "type": "object",

__tests__/respect/inputs-passed-to-step-target-workflow/__snapshots__/inputs-passed-to-step-target-workflow.test.ts.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ exports[`should pass inputs to step target workflow with additional input parame
3535
    Response status code: 201
3636
    Response time: <test> ms
3737
    Response Headers: <response headers test>
38+
    Response Size: <test> bytes
3839
    Response Body:
3940
      {
4041
       "eventId": "dad4bce8-f5cb-4078-a211-995864315e39",

__tests__/respect/inputs-with-cli-and-env/__snapshots__/inputs-with-cli-and-env.test.ts.snap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ exports[`should use inputs from CLI and env 1`] = `
1616
    Response status code: 200
1717
    Response time: <test> ms
1818
    Response Headers: <response headers test>
19+
    Response Size: <test> bytes
1920
    Response Body:
2021
      [
2122
       {
@@ -96,6 +97,7 @@ exports[`should use inputs from CLI and env 1`] = `
9697
    Response status code: 201
9798
    Response time: <test> ms
9899
    Response Headers: <response headers test>
100+
    Response Size: <test> bytes
99101
    Response Body:
100102
      {
101103
       "message": "Museum general entry ticket purchased",
@@ -122,6 +124,7 @@ exports[`should use inputs from CLI and env 1`] = `
122124
    Response status code: 200
123125
    Response time: <test> ms
124126
    Response Headers: <response headers test>
127+
    Response Size: <test> bytes
125128
    Response Body:
126129
      [
127130
       {
@@ -211,6 +214,7 @@ exports[`should use inputs from CLI and env 1`] = `
211214
    Response status code: 201
212215
    Response time: <test> ms
213216
    Response Headers: <response headers test>
217+
    Response Size: <test> bytes
214218
    Response Body:
215219
      {
216220
       "eventId": "dad4bce8-f5cb-4078-a211-995864315e39",

__tests__/respect/mask-input-secrets/__snapshots__/mask-input-secrets.test.ts.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ exports[`should hide sensitive input values 1`] = `
2020
    Response status code: 200
2121
    Response time: <test> ms
2222
    Response Headers: <response headers test>
23+
    Response Size: <test> bytes
2324
    Response Body:
2425
      [
2526
       {
@@ -95,6 +96,7 @@ exports[`should hide sensitive input values 1`] = `
9596
    Response status code: 200
9697
    Response time: <test> ms
9798
    Response Headers: <response headers test>
99+
    Response Size: <test> bytes
98100
    Response Body:
99101
      [
100102
       {
@@ -245,6 +247,7 @@ exports[`should hide sensitive input values 1`] = `
245247
    Response status code: 201
246248
    Response time: <test> ms
247249
    Response Headers: <response headers test>
250+
    Response Size: <test> bytes
248251
    Response Body:
249252
      {
250253
       "eventId": "dad4bce8-f5cb-4078-a211-995864315e39",

__tests__/respect/outputs-access-syntax-variations/__snapshots__/outputs-access-syntax-variations.test.ts.snap

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ exports[`should resolve outputs access syntax variations 1`] = `
1616
    Response status code: 200
1717
    Response time: <test> ms
1818
    Response Headers: <response headers test>
19+
    Response Size: <test> bytes
1920
    Response Body:
2021
      [
2122
       {
@@ -96,6 +97,7 @@ exports[`should resolve outputs access syntax variations 1`] = `
9697
    Response status code: 201
9798
    Response time: <test> ms
9899
    Response Headers: <response headers test>
100+
    Response Size: <test> bytes
99101
    Response Body:
100102
      {
101103
       "message": "Museum general entry ticket purchased",
@@ -126,6 +128,7 @@ exports[`should resolve outputs access syntax variations 1`] = `
126128
    Response status code: 200
127129
    Response time: <test> ms
128130
    Response Headers: <response headers test>
131+
    Response Size: <test> bytes
129132
    Response Body:
130133
      [
131134
       {
@@ -272,6 +275,7 @@ exports[`should resolve outputs access syntax variations 1`] = `
272275
    Response status code: 201
273276
    Response time: <test> ms
274277
    Response Headers: <response headers test>
278+
    Response Size: <test> bytes
275279
    Response Body:
276280
      {
277281
       "eventId": "dad4bce8-f5cb-4078-a211-995864315e39",
@@ -306,6 +310,7 @@ exports[`should resolve outputs access syntax variations 1`] = `
306310
    Response status code: 200
307311
    Response time: <test> ms
308312
    Response Headers: <response headers test>
313+
    Response Size: <test> bytes
309314
    Response Body:
310315
      {
311316
       "eventId": "6744a0da-4121-49cd-8479-f8cc20526495",

__tests__/respect/replacements/__snapshots__/replacements.test.ts.snap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ exports[`should replace values in the request body 1`] = `
1616
    Response status code: 200
1717
    Response time: <test> ms
1818
    Response Headers: <response headers test>
19+
    Response Size: <test> bytes
1920
    Response Body:
2021
      {
2122
       "eventId": "6744a0da-4121-49cd-8479-f8cc20526495",
@@ -57,6 +58,7 @@ exports[`should replace values in the request body 1`] = `
5758
    Response status code: 400
5859
    Response time: <test> ms
5960
    Response Headers: <response headers test>
61+
    Response Size: <test> bytes
6062
    Response Body:
6163
      {
6264
       "type": "object",
@@ -81,6 +83,7 @@ exports[`should replace values in the request body 1`] = `
8183
    Response status code: 400
8284
    Response time: <test> ms
8385
    Response Headers: <response headers test>
86+
    Response Size: <test> bytes
8487
    Response Body:
8588
      {
8689
       "type": "object",
@@ -105,6 +108,7 @@ exports[`should replace values in the request body 1`] = `
105108
    Response status code: 400
106109
    Response time: <test> ms
107110
    Response Headers: <response headers test>
111+
    Response Size: <test> bytes
108112
    Response Body:
109113
      {
110114
       "type": "object",

__tests__/respect/reusable-components/__snapshots__/reusable-components.test.ts.snap

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ exports[`should use inputs from CLI and env to map with resolved refs 1`] = `
1717
    Response status code: 200
1818
    Response time: <test> ms
1919
    Response Headers: <response headers test>
20+
    Response Size: <test> bytes
2021
    Response Body:
2122
      [
2223
       {
@@ -88,6 +89,7 @@ exports[`should use inputs from CLI and env to map with resolved refs 1`] = `
8889
    Response status code: 200
8990
    Response time: <test> ms
9091
    Response Headers: <response headers test>
92+
    Response Size: <test> bytes
9193
    Response Body:
9294
      [
9395
       {
@@ -162,6 +164,7 @@ exports[`should use inputs from CLI and env to map with resolved refs 1`] = `
162164
    Response status code: 200
163165
    Response time: <test> ms
164166
    Response Headers: <response headers test>
167+
    Response Size: <test> bytes
165168
    Response Body:
166169
      [
167170
       {
@@ -239,6 +242,7 @@ exports[`should use inputs from CLI and env to map with resolved refs 1`] = `
239242
    Response status code: 200
240243
    Response time: <test> ms
241244
    Response Headers: <response headers test>
245+
    Response Size: <test> bytes
242246
    Response Body:
243247
      [
244248
       {
@@ -393,6 +397,7 @@ exports[`should use inputs from CLI and env to map with resolved refs 1`] = `
393397
    Response status code: 201
394398
    Response time: <test> ms
395399
    Response Headers: <response headers test>
400+
    Response Size: <test> bytes
396401
    Response Body:
397402
      {
398403
       "eventId": "dad4bce8-f5cb-4078-a211-995864315e39",
@@ -427,6 +432,7 @@ exports[`should use inputs from CLI and env to map with resolved refs 1`] = `
427432
    Response status code: 200
428433
    Response time: <test> ms
429434
    Response Headers: <response headers test>
435+
    Response Size: <test> bytes
430436
    Response Body:
431437
      [
432438
       {

0 commit comments

Comments
 (0)