Skip to content

Commit f42232f

Browse files
committed
feat: add rawConfig for Arazzo preprocessors and decorators
1 parent 1ac4029 commit f42232f

File tree

4 files changed

+19
-79
lines changed

4 files changed

+19
-79
lines changed

.changeset/cool-mails-invent.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@redocly/openapi-core": patch
3+
---
4+
5+
Updated `StyleguideConfig` definition for Arazzo Preprocessors and Decorators.

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

Lines changed: 2 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -212,79 +212,6 @@ exports[`should not follow the default behavior to break and return if onFailure
212212
    ✓ content-type check
213213
    ✓ schema check
214214
215-
Running child workflow for the step call-first-workflow
216-
Running workflow consider-severity-in-next-step-execution.arazzo.yaml / first-workflow
217-
218-
✓ GET /museum-hours - step first-step
219-
220-
    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/museum-hours
221-
    Request Headers:
222-
      accept: application/json, application/problem+json
223-
      authorization: Basic Og==
224-
225-
226-
    Response status code: 200
227-
    Response time: <test> ms
228-
    Response Body:
229-
      [
230-
       {
231-
       "date": "2023-09-11",
232-
       "timeOpen": "09:00",
233-
       "timeClose": "18:00"
234-
       },
235-
       {
236-
       "date": "2023-09-12",
237-
       "timeOpen": "09:00",
238-
       "timeClose": "18:00"
239-
       },
240-
       {
241-
       "date": "2023-09-13",
242-
       "timeOpen": "09:00",
243-
       "timeClose": "18:00"
244-
       },
245-
       {
246-
       "date": "2023-09-14",
247-
       "timeOpen": "09:00",
248-
       "timeClose": "18:00"
249-
       },
250-
       {
251-
       "date": "2023-09-15",
252-
       "timeOpen": "10:00",
253-
       "timeClose": "16:00"
254-
       },
255-
       {
256-
       "date": "2023-09-18",
257-
       "timeOpen": "09:00",
258-
       "timeClose": "18:00"
259-
       },
260-
       {
261-
       "date": "2023-09-19",
262-
       "timeOpen": "09:00",
263-
       "timeClose": "18:00"
264-
       },
265-
       {
266-
       "date": "2023-09-20",
267-
       "timeOpen": "09:00",
268-
       "timeClose": "18:00"
269-
       },
270-
       {
271-
       "date": "2023-09-21",
272-
       "timeOpen": "09:00",
273-
       "timeClose": "18:00"
274-
       },
275-
       {
276-
       "date": "2023-09-22",
277-
       "timeOpen": "10:00",
278-
       "timeClose": "16:00"
279-
       }
280-
      ]
281-
282-
    ✓ success criteria check - $statusCode == 200
283-
    ✓ status code check - $statusCode in [200, 400, 404]
284-
    ✓ content-type check
285-
    ✓ schema check
286-
287-
288215
289216
  Failed tests info:
290217
@@ -297,8 +224,8 @@ exports[`should not follow the default behavior to break and return if onFailure
297224
  Summary for consider-severity-in-next-step-execution.arazzo.yaml
298225
  
299226
  Workflows: 2 passed, 2 total
300-
  Steps: 3 passed, 1 warnings, 3 total
301-
  Checks: 12 passed, 1 warnings, 12 total
227+
  Steps: 2 passed, 1 warnings, 2 total
228+
  Checks: 8 passed, 1 warnings, 8 total
302229
  Time: <test>ms
303230
304231

packages/core/src/config/__tests__/__snapshots__/config.test.ts.snap

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ StyleguideConfig {
66
"_usedVersions": Set {},
77
"configFile": undefined,
88
"decorators": {
9-
"arazzo1": {},
9+
"arazzo1": {
10+
"oas2": {},
11+
"oas3_0": {},
12+
"oas3_1": {},
13+
},
1014
"async2": {
1115
"oas2": {},
1216
"oas3_0": {},
@@ -55,7 +59,11 @@ StyleguideConfig {
5559
"pluginPaths": [],
5660
"plugins": [],
5761
"preprocessors": {
58-
"arazzo1": {},
62+
"arazzo1": {
63+
"oas2": {},
64+
"oas3_0": {},
65+
"oas3_1": {},
66+
},
5967
"async2": {
6068
"oas2": {},
6169
"oas3_0": {},

packages/core/src/config/config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export class StyleguideConfig {
9797
[SpecVersion.OAS3_1]: { ...rawConfig.preprocessors, ...rawConfig.oas3_1Preprocessors },
9898
[SpecVersion.Async2]: { ...rawConfig.preprocessors, ...rawConfig.async2Preprocessors },
9999
[SpecVersion.Async3]: { ...rawConfig.preprocessors, ...rawConfig.async3Preprocessors },
100-
[SpecVersion.Arazzo1]: { ...rawConfig.arazzo1Preprocessors },
100+
[SpecVersion.Arazzo1]: { ...rawConfig.preprocessors, ...rawConfig.arazzo1Preprocessors },
101101
[SpecVersion.Overlay1]: { ...rawConfig.preprocessors, ...rawConfig.overlay1Preprocessors },
102102
};
103103

@@ -107,7 +107,7 @@ export class StyleguideConfig {
107107
[SpecVersion.OAS3_1]: { ...rawConfig.decorators, ...rawConfig.oas3_1Decorators },
108108
[SpecVersion.Async2]: { ...rawConfig.decorators, ...rawConfig.async2Decorators },
109109
[SpecVersion.Async3]: { ...rawConfig.decorators, ...rawConfig.async3Decorators },
110-
[SpecVersion.Arazzo1]: { ...rawConfig.arazzo1Decorators },
110+
[SpecVersion.Arazzo1]: { ...rawConfig.decorators, ...rawConfig.arazzo1Decorators },
111111
[SpecVersion.Overlay1]: { ...rawConfig.decorators, ...rawConfig.overlay1Decorators },
112112
};
113113

0 commit comments

Comments
 (0)