Build OpenAPI Change Impact Report
1. Gather Inputs
- Require a baseline OpenAPI or Swagger source.
- Require a current OpenAPI or Swagger source.
- Require
docs/testing/test-mapping-report.mdwhen test-impact mapping is needed.
2. Choose The Files
- Prefer
docs/testing/openapi-change-impact-report.md. - When the user wants a human-friendly report, also generate
docs/testing/html/openapi-change-impact-report.html.
3. Build The Comparison
- Compare operation existence first.
- Compare operation metadata second: tags, summary, security, parameters, request body, and response codes.
- Classify each difference as
Added,Removed,Breaking change,Non-breaking change, orNo change. - When a traceability report exists, map changed operations back to affected tests and documentation references.
- Keep the report useful even when there is no change.
4. Output Shape
- Start from openapi-change-impact-report-template.md.
- Keep the exact section headings stable.
- Run
python scripts/generate_openapi_change_impact_report.py --baseline <baseline> --current <current> --mapping <mapping-md> --output-md <impact-md> --output-html <impact-html>.
5. Keep It Actionable
- Explain which changed operations need test updates first.
- Separate breaking changes from additive changes.
- Update the session-state artifact after generating or changing the report.
6. Examples
- Input:
Show what changed between these two OpenAPI files and which tests are affected.Output: Createdocs/testing/openapi-change-impact-report.mdand the paired HTML report. - Input:
Compare the live contract to the repo contract.Output: Produce a change-impact report, even if the final result isNo change.
7. Troubleshooting
- Problem: The two sources use different file formats. Fix: Normalize both sources before comparison; YAML vs JSON is not itself a change.
- Problem: There are no contract changes.
Fix: Still generate the report and state
No changeexplicitly.