Docs

Import OpenAPI 3.x and GraphQL

Import an API from a URL, a file or GraphQL introspection; what the compiler does with each operation, the diagnostics it reports, and its limits.

Last updated: 2026-11-26 · Markdown

Sources

SourceHow
URLPaste the spec URL in the console, or set spec.url in neurouter.yaml. Fetched server-side (16 MiB cap, 30 s timeout) under the outbound network policy.
FileUpload in the console, or set spec.path (relative to neurouter.yaml).
GraphQL SDLA schema file with type Query.
GraphQL endpointIn the console, choose GraphQL endpoint and enter its URL, with an optional header such as Authorization for endpoints that require it. The server runs the introspection query once under the outbound network policy (16 MiB cap, 30 s timeout). The header is sent with that request only and never stored. Re-importing introspects again (without the header). From the CLI: npx neurouter compile --graphql-endpoint <url>.
GraphQL introspectionAn introspection JSON result (upload or paste).
SampleTry the sample imports the fictional Acme Orders API (14 operations, examples/acme-orders/openapi.yaml) that ships with the server, so it works offline, with a mock environment.

If the endpoint cannot be introspected, the console says why: unreachable, blocked by the network policy, 401/403 (add an Authorization header), introspection turned off (upload or paste the SDL or an introspection JSON instead), or not a GraphQL endpoint.

The format is detected automatically; set format: openapi | graphql-sdl | graphql-introspection to override.

OpenAPI

  • Versions: OpenAPI 3.0 and 3.1. Swagger 2.0 is rejected with a hint to convert it to OpenAPI 3.x first.
  • One tool per operation (get, put, post, delete, patch, head).
  • Arguments: path, query, header and cookie parameters become properties; a JSON request body with up to 20 properties is spread into the top level, otherwise it becomes one body argument. readOnly properties are dropped from inputs.
  • Credentials are not arguments: header parameters named Authorization, Proxy-Authorization or Cookie, and parameters matching an API-key security scheme, are removed. Credentials come from the environment.
  • Names: overlay name → operationId → method and path, converted to snake_case (^[a-z][a-z0-9_]{0,63}$). Collisions get _2, _3 and a warning.
  • Risk: GET and HEAD are reads; everything else is a write; DELETE is destructive. An x-neurouter-risk extension in the spec, or the overlay, can override this.
  • Descriptions: summary plus description, HTML stripped, up to 1024 characters.
  • Pagination is detected from Link headers and common parameter names (cursor, page/per_page, offset/limit).

GraphQL

  • One tool per field of Query (read) and Mutation (write). Subscriptions are skipped.
  • Arguments map to JSON Schema (Int → integer, ID → string, input objects → nested objects, NonNull → required).
  • A selection set is generated to depth 2 (spec.graphql.selectionDepth, 1–5), with connection patterns (edges { node }, pageInfo) detected. An overlay can replace the selection.

Diagnostics and the preliminary score

The compiler never stops on spec problems it can work around: it reports diagnostics with a JSON pointer into the spec and continues. Spec lint checks descriptions, parameter descriptions and types, names, toolset size, response shaping, examples, write marking and schema depth. Its result is shown as a preliminary readiness score until the first eval run. See Evals.

Re-importing

Importing a new version of the spec creates a new spec revision and build. Overlays act on the tool model, not on lines in the file, so curation carries over; overlay entries that no longer match anything are listed as orphaned after the import. New builds reach dev and qa environments automatically and prod only when you promote them.

Limits

LimitDefault
Spec download size16 MiB
Console upload or paste10 MiB
Tools per build2000
Inline schema depth8 (deeper or recursive schemas use $defs)

OpenAPI 3.0, OpenAPI 3.1, GraphQL SDL and GraphQL introspection JSON are the supported formats.