Skip to content

fix(apisec): load embedded schemas on Windows - #76

Merged
jerrynbc merged 1 commit into
chaitin:mainfrom
Xuxchloris:fix/apisec-embedded-path-windows
Sep 15, 2026
Merged

jerrynbc merged 1 commit into
chaitin:mainfrom
Xuxchloris:fix/apisec-embedded-path-windows

Conversation

@Xuxchloris

Copy link
Copy Markdown
Contributor

Problem

On Windows, APISec cannot load its embedded OpenAPI schema or CLI mapping. filepath.Join produces paths such as v26.05\openapi.json, but embed.FS follows the io/fs contract and accepts slash-separated paths only. This prevents the dynamic APISec command tree from being registered in Windows builds.

Cause

The embedded resource names were constructed with the OS-specific path/filepath package instead of the slash-based path package required by io/fs.

Change

Use path.Join for both embedded schema resource paths. No filesystem paths or runtime API behavior are otherwise changed.

Validation

  • go test ./products/apisec (Windows; passes, and failed with the embedded-path error before this change)
  • go vet ./...
  • go build -o chaitin-cli.exe .
  • go test ./... (APISec and all other packages pass; the existing config package still has three unrelated Windows-only failures from POSIX mode and symlink privilege assumptions)

@jerrynbc
jerrynbc merged commit 89bbf7c into chaitin:main Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants