feat: lint arazzo test descriptions
What/Why/How?
Add Arazzo validation to the lint cli command.
Now it is possible to lint Arazzo description file by running redocly lint museum.yaml
Reference
Testing
Screenshots (optional)
Check yourself
- [ ] Code changed? - Tested with redoc/reference-docs/workflows (internal)
- [x] All new/updated code is covered with tests
- [ ] New package installed? - Tested in different environments (browser/node)
Security
- [x] Security impact of change has been considered
- [x] Code follows company security practices and guidelines
🦋 Changeset detected
Latest commit: 54bce5573eab6fbd560b13e57beff2e8ca44c266
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 2 packages
| Name | Type |
|---|---|
| @redocly/openapi-core | Minor |
| @redocly/cli | Minor |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
redocly lint packages/core/src/benchmark/benches/rebilly.yaml |
992.0 ± 17.2 | 962.8 | 1016.6 | 1.00 |
redocly-next lint packages/core/src/benchmark/benches/rebilly.yaml |
1004.4 ± 20.6 | 980.1 | 1044.9 | 1.01 ± 0.03 |
Coverage report
St.:grey_question: |
Category | Percentage | Covered / Total |
|---|---|---|---|
| 🟡 | Statements | 77.22% | 4565/5912 |
| 🟡 | Branches | 67.18% | 2512/3739 |
| 🟡 | Functions | 70.72% | 751/1062 |
| 🟡 | Lines | 77.45% | 4300/5552 |
Show new covered files 🐣
St.:grey_question: |
File | Statements | Branches | Functions | Lines |
|---|---|---|---|---|---|
| 🟢 | ... / arazzo.ts |
100% | 100% | 100% | 100% |
| 🟢 | ... / index.ts |
100% | 100% | 100% | 100% |
| 🟢 | ... / index.ts |
100% | 100% | 100% | 100% |
| 🟢 | ... / index.ts |
100% | 100% | 100% | 100% |
Show files with reduced coverage 🔻
St.:grey_question: |
File | Statements | Branches | Functions | Lines |
|---|---|---|---|---|---|
| 🟡 | ... / config.ts |
65.27% (-5.05% 🔻) |
67.28% (-10.02% 🔻) |
61.29% (-6.57% 🔻) |
65.77% (-4.23% 🔻) |
| 🟢 | ... / oas-types.ts |
93.62% (-3.88% 🔻) |
85.71% (-7.62% 🔻) |
100% | 93.62% (-3.88% 🔻) |
| 🟢 | ... / config-resolvers.ts |
84% | 75.72% | 100% | 84.62% |
| 🟡 | core/src/bundle.ts | 75% (-3.52% 🔻) |
62.71% (-7.76% 🔻) |
94.12% | 75% (-3.52% 🔻) |
| 🟢 | core/src/index.ts | 100% | 100% | 8.93% | 100% |
Test suite run success
750 tests passing in 105 suites.
Report generated by 🧪jest coverage report action from 54bce5573eab6fbd560b13e57beff2e8ca44c266
It's a small thing, but we should also update the CLI help output to add arazzo to the lint command description.
Linting some of the Arazzo examples from the main project, I get some errors "The field
inmust be present on this level." but the entry looks like this:workflowId: place-order parameters: - name: pet_id value: $steps.find-pet.outputs.my_pet_idLooking at the spec document for parameters, I think the "in" isn't required when it's a reference to something that's already in the scope of an Arazzo workflow.
Thanks Lorna, We have a task for this issue => https://github.com/orgs/Redocly/projects/51/views/1?pane=issue&itemId=65948722
We don't have support for references in step parameters (or I'm doing something wrong! Testing the pet coupons example ), will we list that as not supported, or should we add it? https://github.com/OAI/Arazzo-Specification/blob/main/versions/1.0.0.md#step-object