fix: join paths properly
What/Why/How?
Currently summary, description, servers, parameters fields are ignored/incorrectly handled by join command.
This PR is rework for join command based on this one. The reason is that changes in the latest is based just on checking if the value of PathItem field is of object type. I suppose that current logic performed on object values is making sense only for Operation Object type. summary, description, servers and parameters should be joined in a different way.
Things required to finish this PR:
- [x] Merge only operations (
post,get, etc.) using existing implementation - [ ] Implement join of
Operation Objects which are $refs - [ ] Implement join of
summaryanddescription - [ ] Implement join of
servers - [ ] Implement join of
parameters - [ ] Add meaningful tests for join command
Reference
Testing
Screenshots (optional)
Check yourself
- [x] Code is linted
- [ ] Tested with redoc/reference-docs/workflows
- [ ] All new/updated code is covered with tests
Security
- [ ] Security impact of change has been considered
- [ ] Code follows company security practices and guidelines
Coverage report
St.:grey_question: |
Category | Percentage | Covered / Total |
|---|---|---|---|
| 🟡 | Statements | 72.23% (+3.31% 🔼) |
3103/4296 |
| 🟡 | Branches | 64.15% (+2% 🔼) |
1680/2619 |
| 🟡 | Functions | 63.91% (+3.35% 🔼) |
503/787 |
| 🟡 | Lines | 72.22% (+3.45% 🔼) |
2885/3995 |
Show files with reduced coverage 🔻
St.:grey_question: |
File | Statements | Branches | Functions | Lines |
|---|---|---|---|---|---|
| 🟢 | cli/src/js-utils.ts | 90.91% (-9.09% 🔻) |
83.33% (-16.67% 🔻) |
100% | 100% |
Test suite run success
475 tests passing in 81 suites.
Report generated by 🧪jest coverage report action from 7f0a4e46d98b66feff7348d278b49ecd82073483
For description and summary - take it from first document
For servers - create unique array by url from both documents
@adamaltman @RomanHotsiy please advice how to join parameters ? Should we create unique array by name and in fields ?
Can you exclude prettier changes from this PR? It's hard to review :(
removed
For description and summary - take it from first document
Yes, I would also show a warning if there are different values and they mismatch.
For servers - create unique array by url from both documents
Yes. I would also show a warning or even crash if there are different values and they mismatch (e.g. variables)
how to join parameters ? Should we create unique array by name and in fields ?
Yes. Unique by name/in seems valid. Make sure to crash if there are different schemas. For different descriptions we can show warnings only.
LGTM 👍