This loop ensures that the API implementation aligns with the OpenAPI specification by repeatedly validating the contract using swagger-cli until all requirements are met or the maximum iteration limit is reached.
API implementation matches OpenAPI specification
Run this loop in a coding environment to validate your OpenAPI spec compliance through iterative corrections.
Set Up Environment
Ensure `openapi.yaml` exists in your project root and `swagger-cli` is installed globally or available in your PATH.
Initiate Loop
Use the kickoff prompt to start the loop. The agent will attempt to correct validation issues in each iteration.
Monitor Iterations
The loop runs up to 10 times. If it exits early due to success, review changes made. If it hits max iterations, manual intervention may be needed.
Verify Final Output
After exit, confirm the `openapi.yaml` passes validation independently using `swagger-cli validate openapi.yaml`.
Act
The agent attempts to fix any validation issues in the API implementation based on the current state of openapi.yaml.
API
This loop standardizes API error responses across the application to improve client-side error handling and debugging. It ensures all error responses follow a consistent structure (e.g., RFC 7807 Problem Details format) with appropriate HTTP status codes and machine-readable error codes.
API
Automatically detects and resolves issues in failing API integration endpoints through iterative testing and code modifications.
API
A coding loop focused on optimizing API performance to ensure P95 latency stays under a defined target threshold. This loop iteratively runs load tests, analyzes bottlenecks, and implements optimizations until the goal is achieved or maximum iterations are reached.
Run Check
Execute `swagger-cli validate openapi.yaml` to assess conformance with OpenAPI standards.
Inspect Result
Analyze validation output for errors. If none, exit loop; otherwise, proceed to next iteration.
Repeat
If validation failed and iterations remain under 10, return to Act step with updated context.
Start the "API Contract Until Passing" loop. Goal: API implementation matches OpenAPI specification Max iterations: 10 Between iterations run: swagger-cli validate openapi.yaml Exit when: Contract validation succeeds Please validate the API implementation against the OpenAPI specification defined in 'openapi.yaml'. Run swagger-cli to check for compliance and fix any issues found until validation passes or 10 iterations are completed. Self-pace this loop. After each iteration, run `swagger-cli validate openapi.yaml` and evaluate the output, and only continue if the exit condition is not met (Contract validation succeeds). Stop when the exit condition passes or 10 iterations are reached. Give a short status update each pass.