feat(mockapi): add OpenAPI validation draft#35
Draft
miguelsanchez-upsun wants to merge 5 commits intomainfrom
Draft
feat(mockapi): add OpenAPI validation draft#35miguelsanchez-upsun wants to merge 5 commits intomainfrom
miguelsanchez-upsun wants to merge 5 commits intomainfrom
Conversation
… path Remove automatic OpenAPI spec download functionality from test runtime. Spec will now be downloaded via Makefile only. Changes: - Delete openapi_download.go and openapi_download_test.go (~200 lines) - Update loadOpenAPISpec() to use fixed path: pkg/mockapi/testdata/upsun-openapi.json - Remove ensureOpenAPISpec() path-hunting logic - Validation gracefully disables when spec missing (shows warning) Part of CLI-124: OpenAPI validation implementation Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Update Makefile to automatically download OpenAPI spec as dependency of integration tests. Add module root resolution for reliable path handling across different test contexts. Changes: - Add pkg/mockapi/testdata/upsun-openapi.json file target in Makefile - Make integration-test depend on spec file (downloads if missing) - Add findModuleRoot() to locate spec from any test working directory - Works from both pkg/mockapi tests and integration-tests Part of CLI-124: OpenAPI validation implementation Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add explicit step to download OpenAPI specification before running integration tests. Spec downloads once per CI run (no caching). Part of CLI-124: OpenAPI validation implementation Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add infrastructure to validate mock API responses against the official
Upsun OpenAPI specification with automatic spec download:
The validation middleware can be enabled with VALIDATE_OPENAPI=1 to catch
discrepancies between mock responses and the real API specification.
Environment variables:
Usage:
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com