@@ -5,7 +5,7 @@ import { runRefObjectDescriptionTests } from './templates/reference-object-31.te
55
66const  SUITE_ID  =  'response-body-examples' 
77
8- const  COMMON_PATH  =  [ 'paths' ,  '/path1' ,  'post' ,  'responses' ,  '200' ,  'content' ,  'application/json' ,  'examples' ] 
8+ const  RESPONSE_CONTENT_EXAMPLES_PATH  =  [ 'paths' ,  '/path1' ,  'post' ,  'responses' ,  '200' ,  'content' ,  'application/json' ,  'examples' ] 
99
1010describe ( 'Openapi3 Response Body Examples' ,  ( )  =>  { 
1111
@@ -15,7 +15,7 @@ describe('Openapi3 Response Body Examples', () => {
1515    expect ( result ) . toEqual ( diffsMatcher ( [ 
1616      expect . objectContaining ( { 
1717        action : DiffAction . add , 
18-         afterDeclarationPaths : [ [ ...COMMON_PATH ,  'example1' ] ] , 
18+         afterDeclarationPaths : [ [ ...RESPONSE_CONTENT_EXAMPLES_PATH ,  'example1' ] ] , 
1919        type : annotation , 
2020      } ) , 
2121    ] ) ) 
@@ -27,7 +27,7 @@ describe('Openapi3 Response Body Examples', () => {
2727    expect ( result ) . toEqual ( diffsMatcher ( [ 
2828      expect . objectContaining ( { 
2929        action : DiffAction . add , 
30-         afterDeclarationPaths : [ [ ...COMMON_PATH ,  'example2' ] ] , 
30+         afterDeclarationPaths : [ [ ...RESPONSE_CONTENT_EXAMPLES_PATH ,  'example2' ] ] , 
3131        type : annotation , 
3232      } ) , 
3333    ] ) ) 
@@ -39,8 +39,8 @@ describe('Openapi3 Response Body Examples', () => {
3939    expect ( result ) . toEqual ( diffsMatcher ( [ 
4040      expect . objectContaining ( { 
4141        action : DiffAction . replace , 
42-         beforeDeclarationPaths : [ [ ...COMMON_PATH ,  'example1' ,  'value' ] ] , 
43-         afterDeclarationPaths : [ [ ...COMMON_PATH ,  'example1' ,  'value' ] ] , 
42+         beforeDeclarationPaths : [ [ ...RESPONSE_CONTENT_EXAMPLES_PATH ,  'example1' ,  'value' ] ] , 
43+         afterDeclarationPaths : [ [ ...RESPONSE_CONTENT_EXAMPLES_PATH ,  'example1' ,  'value' ] ] , 
4444        type : annotation , 
4545      } ) , 
4646    ] ) ) 
@@ -52,12 +52,12 @@ describe('Openapi3 Response Body Examples', () => {
5252    expect ( result ) . toEqual ( diffsMatcher ( [ 
5353      expect . objectContaining ( { 
5454        action : DiffAction . remove , 
55-         beforeDeclarationPaths : [ [ ...COMMON_PATH ,  'example1' ] ] , 
55+         beforeDeclarationPaths : [ [ ...RESPONSE_CONTENT_EXAMPLES_PATH ,  'example1' ] ] , 
5656        type : annotation , 
5757      } ) , 
5858      expect . objectContaining ( { 
5959        action : DiffAction . add , 
60-         afterDeclarationPaths : [ [ ...COMMON_PATH ,  'example0' ] ] , 
60+         afterDeclarationPaths : [ [ ...RESPONSE_CONTENT_EXAMPLES_PATH ,  'example0' ] ] , 
6161        type : annotation , 
6262      } ) , 
6363    ] ) ) 
@@ -69,8 +69,8 @@ describe('Openapi3 Response Body Examples', () => {
6969    expect ( result ) . toEqual ( diffsMatcher ( [ 
7070      expect . objectContaining ( { 
7171        action : DiffAction . replace , 
72-         beforeDeclarationPaths : [ [ ...COMMON_PATH ,  'example1' ,  'externalValue' ] ] , 
73-         afterDeclarationPaths : [ [ ...COMMON_PATH ,  'example1' ,  'externalValue' ] ] , 
72+         beforeDeclarationPaths : [ [ ...RESPONSE_CONTENT_EXAMPLES_PATH ,  'example1' ,  'externalValue' ] ] , 
73+         afterDeclarationPaths : [ [ ...RESPONSE_CONTENT_EXAMPLES_PATH ,  'example1' ,  'externalValue' ] ] , 
7474        type : annotation , 
7575      } ) , 
7676    ] ) ) 
@@ -82,7 +82,7 @@ describe('Openapi3 Response Body Examples', () => {
8282    expect ( result ) . toEqual ( diffsMatcher ( [ 
8383      expect . objectContaining ( { 
8484        action : DiffAction . remove , 
85-         beforeDeclarationPaths : [ [ ...COMMON_PATH ,  'example1' ,  'externalValue' ] ] , 
85+         beforeDeclarationPaths : [ [ ...RESPONSE_CONTENT_EXAMPLES_PATH ,  'example1' ,  'externalValue' ] ] , 
8686        type : annotation , 
8787      } ) , 
8888    ] ) ) 
@@ -94,7 +94,7 @@ describe('Openapi3 Response Body Examples', () => {
9494    expect ( result ) . toEqual ( diffsMatcher ( [ 
9595      expect . objectContaining ( { 
9696        action : DiffAction . add , 
97-         afterDeclarationPaths : [ [ ...COMMON_PATH ,  'example1' ,  'summary' ] ] , 
97+         afterDeclarationPaths : [ [ ...RESPONSE_CONTENT_EXAMPLES_PATH ,  'example1' ,  'summary' ] ] , 
9898        type : annotation , 
9999      } ) , 
100100    ] ) ) 
@@ -106,8 +106,8 @@ describe('Openapi3 Response Body Examples', () => {
106106    expect ( result ) . toEqual ( diffsMatcher ( [ 
107107      expect . objectContaining ( { 
108108        action : DiffAction . replace , 
109-         beforeDeclarationPaths : [ [ ...COMMON_PATH ,  'example1' ,  'summary' ] ] , 
110-         afterDeclarationPaths : [ [ ...COMMON_PATH ,  'example1' ,  'summary' ] ] , 
109+         beforeDeclarationPaths : [ [ ...RESPONSE_CONTENT_EXAMPLES_PATH ,  'example1' ,  'summary' ] ] , 
110+         afterDeclarationPaths : [ [ ...RESPONSE_CONTENT_EXAMPLES_PATH ,  'example1' ,  'summary' ] ] , 
111111        type : annotation , 
112112      } ) , 
113113    ] ) ) 
@@ -119,7 +119,7 @@ describe('Openapi3 Response Body Examples', () => {
119119    expect ( result ) . toEqual ( diffsMatcher ( [ 
120120      expect . objectContaining ( { 
121121        action : DiffAction . remove , 
122-         beforeDeclarationPaths : [ [ ...COMMON_PATH ,  'example1' ,  'summary' ] ] , 
122+         beforeDeclarationPaths : [ [ ...RESPONSE_CONTENT_EXAMPLES_PATH ,  'example1' ,  'summary' ] ] , 
123123        type : annotation , 
124124      } ) , 
125125    ] ) ) 
@@ -131,7 +131,7 @@ describe('Openapi3 Response Body Examples', () => {
131131    expect ( result ) . toEqual ( diffsMatcher ( [ 
132132      expect . objectContaining ( { 
133133        action : DiffAction . add , 
134-         afterDeclarationPaths : [ [ ...COMMON_PATH ,  'example1' ,  'description' ] ] , 
134+         afterDeclarationPaths : [ [ ...RESPONSE_CONTENT_EXAMPLES_PATH ,  'example1' ,  'description' ] ] , 
135135        type : annotation , 
136136      } ) , 
137137    ] ) ) 
@@ -143,8 +143,8 @@ describe('Openapi3 Response Body Examples', () => {
143143    expect ( result ) . toEqual ( diffsMatcher ( [ 
144144      expect . objectContaining ( { 
145145        action : DiffAction . replace , 
146-         beforeDeclarationPaths : [ [ ...COMMON_PATH ,  'example1' ,  'description' ] ] , 
147-         afterDeclarationPaths : [ [ ...COMMON_PATH ,  'example1' ,  'description' ] ] , 
146+         beforeDeclarationPaths : [ [ ...RESPONSE_CONTENT_EXAMPLES_PATH ,  'example1' ,  'description' ] ] , 
147+         afterDeclarationPaths : [ [ ...RESPONSE_CONTENT_EXAMPLES_PATH ,  'example1' ,  'description' ] ] , 
148148        type : annotation , 
149149      } ) , 
150150    ] ) ) 
@@ -156,14 +156,14 @@ describe('Openapi3 Response Body Examples', () => {
156156    expect ( result ) . toEqual ( diffsMatcher ( [ 
157157      expect . objectContaining ( { 
158158        action : DiffAction . remove , 
159-         beforeDeclarationPaths : [ [ ...COMMON_PATH ,  'example1' ,  'description' ] ] , 
159+         beforeDeclarationPaths : [ [ ...RESPONSE_CONTENT_EXAMPLES_PATH ,  'example1' ,  'description' ] ] , 
160160        type : annotation , 
161161      } ) , 
162162    ] ) ) 
163163  } ) 
164164} ) 
165165
166- const  PATH_TO_COMPONENTS_DESCRIPTION  =  [ 'components' ,  'examples' ,  'ex1'  ,   'description '] 
166+ const  COMPONENTS_EXAMPLES_PATH  =  [ 'components' ,  'examples' ,  'ex1' ] 
167167describe ( 'Reference object. Response body examples. Description fields in ref object' ,  ( )  =>  { 
168-   runRefObjectDescriptionTests ( SUITE_ID ,  [ ...COMMON_PATH ,  'ex1' ,   'description' ] ,  PATH_TO_COMPONENTS_DESCRIPTION ) 
168+   runRefObjectDescriptionTests ( SUITE_ID ,  [ ...RESPONSE_CONTENT_EXAMPLES_PATH ,  'ex1' ] ,  COMPONENTS_EXAMPLES_PATH ) 
169169} ) 
0 commit comments