OpenAPI: split import into URL and file commands with e2e tests#6
Merged
Conversation
Resolve conflicts keeping OpenAPI branch's refactored code: - pr.yml: keep both ReportGenerator and dotnet-script tool installs - package.json: keep icon on importOpenApi command - constants.ts: keep all OpenAPI + numeric constants - extension.ts: keep refactored module structure - csx/playlist e2e tests: keep extractStepLines helper usage - openApiGenerator.ts: removed (generation moved to F#) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…esponse headers, e2e tests
…essage These messages block indefinitely on headless CI (xvfb). Changed to fire-and-forget with void operator, matching the pattern used before this branch. Added allowAsStatement to no-void eslint rule to support this pattern.
MelbourneDeveloper
added a commit
that referenced
this pull request
Mar 15, 2026
# TLDR; Split the single OpenAPI import button into two: cloud icon for URL import (downloads spec via HTTPS) and file icon for local file import. Added context menu commands, response/request headers in panels, and e2e tests with real network calls. # Details - **Two import commands**: `napper.importOpenApiUrl` (cloud icon) downloads an OpenAPI spec from a URL; `napper.importOpenApiFile` (file icon) picks a local spec file - **URL download**: HTTPS with redirect following, error handling for 4xx responses - **Context menus**: add-to-playlist, duplicate, delete, copy path, enrich with AI - **Response panel**: now shows request headers alongside response headers - **Playlist panel**: shows request/response headers per step - **Report generator**: includes request/response headers in HTML reports - **F# Output.fs**: additional output formatting - **E2e tests**: real network calls to petstore swagger URL, 404 error handling, redirect following, temp file creation # How do the tests prove the change works - `downloadSpec fetches valid OpenAPI from petstore URL` — makes a real HTTPS call to petstore3.swagger.io, parses the JSON, asserts it has `openapi` version field and `paths` with entries - `downloadSpec returns error for 404 URL` — hits httpbin.org/status/404, asserts the result is an error with the correct prefix - `downloadSpec follows redirects` — uses httpbin.org redirect-to endpoint, verifies the final response is valid OpenAPI - `saveTempSpec writes file and returns path` — writes to a real temp dir, reads back, asserts content matches - `saveTempSpec overwrites existing file` — writes twice, asserts second content wins - Command registration tests verify both `napper.importOpenApiUrl` and `napper.importOpenApiFile` are registered ---------
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.
TLDR;
Split the single OpenAPI import button into two: cloud icon for URL import (downloads spec via HTTPS) and file icon for local file import. Added context menu commands, response/request headers in panels, and e2e tests with real network calls.
Details
napper.importOpenApiUrl(cloud icon) downloads an OpenAPI spec from a URL;napper.importOpenApiFile(file icon) picks a local spec fileHow do the tests prove the change works
downloadSpec fetches valid OpenAPI from petstore URL— makes a real HTTPS call to petstore3.swagger.io, parses the JSON, asserts it hasopenapiversion field andpathswith entriesdownloadSpec returns error for 404 URL— hits httpbin.org/status/404, asserts the result is an error with the correct prefixdownloadSpec follows redirects— uses httpbin.org redirect-to endpoint, verifies the final response is valid OpenAPIsaveTempSpec writes file and returns path— writes to a real temp dir, reads back, asserts content matchessaveTempSpec overwrites existing file— writes twice, asserts second content winsnapper.importOpenApiUrlandnapper.importOpenApiFileare registered