scripts

command
v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

filter_spec trims the upstream E2B OpenAPI specs down to the surface the Go SDK generates clients for. It mirrors the decorators in upstream E2B/redocly.yaml (which the JS/Python SDK pipelines run through `redocly bundle`) so our oapi-codegen inputs stay equivalent without a Node.js toolchain:

  • every mode: drop any node marked `x-not-implemented: true` (operations, schemas, properties, ...);
  • mode "internal" (envd.yaml, openapi-volumecontent.yml): drop operations marked `x-internal: true` (orchestrator-only control endpoints such as envd's /init, whose `x-go-type: SecureToken` does not compile outside envd);
  • mode "api" (openapi.yml): keep only operations whose tags intersect the SDK tag set (plus GET /health), dropping admin/console endpoints;

after which path items left without operations are removed and unreferenced components are pruned (redocly's remove-unused-components).

The filter is deliberately dependency-free (no YAML library in go.mod): it works on the block-structured layout upstream uses (2-space indentation, paths at indent 2, operations at indent 4, operation fields at indent 6, components at indent 2/4) and removes whole line blocks, so every kept line stays byte-identical to upstream. It fails loudly if the layout changes.

Usage (invoked by scripts/sync-spec.sh):

go run -mod=readonly ./scripts/filter_spec.go <api|internal> <file.yml> [<file.yml>...]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL