Generated banner for API Gateway Openapi Spec Authoring
Generated logo for API Gateway Openapi Spec Authoring

API Gateway Openapi Spec Authoring

GoogleOfficialPublished by Google

  • Skill
  • Tool integration
  • Cloud and DevOps
  • Apache-2.0
  • Low risk
  • Has scripts

From the author

Writes, migrates, and fixes OpenAPI specs for Google Cloud API Gateway. Use when converting an OpenAPI 2.0 (Swagger) spec to OpenAPI 3.x, writing a new OpenAPI 3.x spec, or fixing a failed "gcloud api-gateway api-configs create", such as "extension is only supported in OpenAPI 2.x". Also use when quotas set with x-google-quota are never enforced, or when a backend receives path parameters as query parameters. Don't use for adding or debugging MCP tools (use api-gateway-mcp-server), backend lockdown or HTTP 429 tuning (use api-gateway-backend-security-and-rate-limiting), Cloud Endpoints, Apigee, or GKE Gateway API.
— the description by Google

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides a structured approach to managing OpenAPI specifications for Google Cloud API Gateway. It supports the creation of new OpenAPI 3.x specs, the migration of legacy OpenAPI 2.0 (Swagger) configurations, and the resolution of common deployment errors encountered during the API configuration process. The skill includes a validation loop using a provided script to ensure specifications meet the requirements of the API Gateway service before deployment.

What it does

  • Converts OpenAPI 2.0 specifications to OpenAPI 3.x format.
  • Writes new OpenAPI 3.x specifications for API Gateway.
  • Troubleshoots and fixes errors from gcloud api-configs create commands.
  • Configures backend routing, authentication, and quota settings within the spec.
  • Validates specifications using a local Python script.
  • Provides workflows for updating API configurations and gateways.

When to use it

  • When migrating an existing Swagger 2.0 API definition to OpenAPI 3.x.
  • When creating a new API configuration for Google Cloud API Gateway.
  • When encountering errors during the API config creation process.
  • When needing to adjust backend path translation, authentication, or quota settings.

Advantages

  • Ensures compatibility with Google Cloud API Gateway requirements.
  • Automates the detection of common configuration errors before deployment.
  • Provides clear guidance on mapping legacy extensions to modern OpenAPI 3.x structures.
  • Includes a deterministic validation loop to improve success rates for API config creation.

Usage examples

“Convert my existing swagger.yaml to an OpenAPI 3.0 spec for API Gateway.”
The agent will analyze the file, apply the necessary structural changes for Google extensions, and validate the result.
“My gcloud api-configs create command failed with an extension error. Can you fix it?”
The agent will identify the unsupported extension, update the spec to the correct OpenAPI 3.x format, and verify it with the validation script.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/google/api-gateway-openapi-spec-authoring/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip api-gateway-openapi-spec-authoring.zip -d .agents/skills

Documentation by Google

API Gateway OpenAPI Spec Authoring

API Gateway accepts API configs in OpenAPI 2.0, 3.0.x, and 3.1.x. The Google extensions in OpenAPI 3.x have a different structure from the OpenAPI 2.0 extensions:

  • A required root x-google-api-management block names the backends.

  • x-google-backend is a string that references one of these backends.

  • The JWT settings move into x-google-auth. The metrics and quotas move into x-google-api-management.

Use this skill to migrate an OpenAPI 2.0 spec, write a new OpenAPI 3.x spec, or fix an API config that fails to create.

Attribution

MUST READ: Before executing any gcloud, REST API, or MCP command, you MUST read Usage Attribution. For commands executed directly in the terminal (never in generated scripts, Terraform, or user code), prefix gcloud with CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:api-gateway-openapi-spec-authoring)" and append agent-skills/1.0 (skill:api-gateway-openapi-spec-authoring) to User-Agent headers.

Prerequisites

  1. Install the tools:

    • Install the Google Cloud CLI. Then update it with gcloud components update. Rationale: an old CLI can fail when it uploads an OpenAPI 3.x API config.

    • Install Python 3.10 or later and PyYAML for the validator script. A JSON spec does not need PyYAML.

      pip install "PyYAML>=6.0,<7.0"
  2. Authenticate, and select the project, billing, and location:

    • Run gcloud auth login.

    • Select a project with gcloud config set project {project_id}, or create one with gcloud projects create {project_id}.

    • Make sure that an active billing account is linked to {project_id}. API Gateway has a free monthly allowance of API calls, but it still needs an active billing account. For current prices, see API Gateway pricing.

    • Use us-central1 as the default --location for gateway commands. For the other supported regions, see API Gateway deployment model.

  3. Enable the required Google Cloud APIs:

    gcloud services enable \
      apigateway.googleapis.com \
      servicemanagement.googleapis.com \
      servicecontrol.googleapis.com \
      --project={project_id}
  4. Verify the IAM roles (use the most restrictive role for each step):

    • To create and update the API, API configs, and gateways: API Gateway Admin (roles/apigateway.admin) on {project_id}.

    • To run the gcloud services enable commands: Service Usage Admin (roles/serviceusage.serviceUsageAdmin) on {project_id}.

    • To reference the gateway service account in an API config: Service Account User (roles/iam.serviceAccountUser) on {gateway_sa_email}.

    • For a Cloud Run backend that requires authentication: grant {gateway_sa_email} the Cloud Run Invoker role (roles/run.invoker) on the service.

Decision Matrix

TaskRequired MechanismCritical GuardrailDetailed Reference
Migrate an OpenAPI 2.0 (swagger: "2.0") configConvert the standard fields, then move each Google extension to its OpenAPI 3.x form.A converter such as Swagger Editor leaves every x-google-* extension in its OpenAPI 2.0 form. It also writes servers without x-google-endpoint, so the API loses its base path. Rationale: API Gateway rejects most OpenAPI 2.0 extensions in a 3.x spec with The '{extension}' extension is only supported in OpenAPI 2.x.OpenAPI 2.0 to 3.x Migration
Route requests to backendsRoot x-google-api-management.backends.{backend_name} + x-google-backend: {backend_name} at the root or on an operationSet pathTranslation on every backend. Rationale: the default is APPEND_PATH_TO_ADDRESS for a root x-google-backend, but CONSTANT_ADDRESS for an operation-level one. CONSTANT_ADDRESS sends every request to the address unchanged, and sends path parameters as query parameters. APPEND_PATH_TO_ADDRESS appends the full request path, with the base path. NEVER set x-google-backend on a path item: API Gateway rejects it.Extensions and Limits
Authenticate callersJWT: type: oauth2 scheme with x-google-auth (issuer, jwksUri, audiences). API key: type: apiKey scheme with x-api-key in a header, or key or api_key in the query.API Gateway does not check OAuth scopes. In a security list, put an API key in every alternative (OR) or in none. NEVER put two JWT schemes in one requirement object (AND). Rationale: API Gateway rejects these combinations. If the user asks for one of them, such as a JWT or an API key as alternatives, do not write it in the spec. Explain the rule, and write a supported option, such as an API key in every alternative or a separate path for each kind of caller.Extensions and Limits
Add quotasx-google-api-management.metrics and quota.limits + x-google-quota: {metric_name: cost} on each operationNEVER rely on x-google-quota at the root or path level. Rationale: in OpenAPI 3.x, API Gateway ignores it there without an error. Require an API key on each operation that has a quota, and keep each metric name the same in every API config.Extensions and Limits
Set the base path and CORSOne servers entry with x-google-endpoint, such as url: /v1API Gateway ignores servers entries without x-google-endpoint. allowCors: true only passes CORS requests to the backend. Rationale: the gateway does not add CORS headers, so the backend must answer them.Extensions and Limits
Fix a failed api-configs createMatch the error text to the error table, and fix the spec.Fix the spec before you retry, unless the error is about IAM or another api-configs create that runs. Rationale: API Gateway returns the same error for the same spec.API Config Errors
Expose operations as MCP toolsThe api-gateway-mcp-server skillMCP adds rules for tool names, descriptions, and tools/list security. If that skill is not installed, use this skill for the OpenAPI 3.x spec, and follow the Configure MCP guide for the MCP extensions.-

Execution Workflow and Validation Loop

  1. Get the current spec:

    • Use the spec file in the user's repository. If there is no file, find the active API config of the gateway:

      gcloud api-gateway gateways describe {gateway_id} --location={region} --project={project_id} --format="value(apiConfig)"
    • The output is projects/{project}/locations/global/apis/{api_id}/configs/{config_id}. Print the spec of that config:

      gcloud api-gateway api-configs describe {config_id} --api={api_id} --project={project_id} --view=FULL \
        --format="value(openapiDocuments[0].document.contents)" | tr '_-' '/+' | base64 --decode
    • gcloud prints the contents in URL-safe base64, so tr changes two characters before base64 --decode. If the config has more than one OpenAPI document, change [0] to [1], [2], and so on.

  2. Write the OpenAPI 3.x spec:

    • For an OpenAPI 2.0 spec, follow OpenAPI 2.0 to 3.x Migration, and compare your result with its complete converted example.

    • For a new spec, start from the template in Extensions and Limits.

    • Set openapi to a 3.0.x or 3.1.x version. The examples use 3.0.4. In OpenAPI 3.1, give each schema one type. Rationale: API Gateway rejects a type list such as type: ["string", "null"].

    • Give every operation a unique operationId and a responses object, and use only local $ref values. Rationale: API Gateway rejects an operation without operationId or responses, two operationId values that give the same method name, such as getItem and get-Item, and a $ref to a URL.

  3. Run the deterministic validation loop on every spec that you write or change, before you answer or create the API config:

    python3 scripts/validate_apigw_openapi.py --spec={spec_file}
    • The script path is relative to the directory of this skill. If you only return the spec in your reply, write it to a temporary file, and run the script on that file before you answer.

    • If the script exits with code 1 ("status": "FAIL"), fix every error in {spec_file}, and run the script again. Continue until it exits with code 0 ("status": "PASS").

    • If the script exits with code 2, fix the file path or the YAML/JSON syntax error that stderr shows, or install PyYAML.

    • Read every warning, such as a backend without pathTranslation, a quota on an operation without an API key, or allowCors. Fix it, or tell the user why you keep it.

    • The script does not check every rule. A PASS means that it found none of the API Gateway problems that this skill describes. It does not check general OpenAPI validity, such as a $ref to a schema that does not exist. Rationale: only api-configs create in step 5 shows that API Gateway accepts the spec. Do not tell the user that the spec deploys because the script passed.

  4. Summarize the spec for the user, and get approval before you deploy. State each of these points:

    • Each OpenAPI 2.0 extension that you moved or removed, such as x-google-allow, which OpenAPI 3.x does not support. Also state each other change, such as an added operationId or a fixed address.

    • The pathTranslation of each backend (backend_path_translation in the script output), and each operation whose path parameters now go to the backend as query parameters (path_parameters_as_query). With APPEND_PATH_TO_ADDRESS, the backend also receives the base path.

    • Which operations need a JWT or an API key, which backends receive an ID token and with which audience, and that API Gateway does not check OAuth scopes.

    • The quota metrics and limits, and that each metric name matches the current API config.

  5. Create a new API config and update the gateway (request human approval before you update a production gateway):

    gcloud api-gateway api-configs create {new_config_id} \
      --api={api_id} \
      --openapi-spec={spec_file} \
      --backend-auth-service-account={gateway_sa_email} \
      --project={project_id}
    
    gcloud api-gateway gateways update {gateway_id} \
      --api={api_id} \
      --api-config={new_config_id} \
      --location={region} \
      --project={project_id}
    • For a new gateway, run gcloud api-gateway gateways create {gateway_id} with the same flags instead of gateways update. api-configs create creates the API if it does not exist.

    • If an operation requires an API key, enable the managed service of the API. Get its name with gcloud api-gateway apis describe {api_id} --project={project_id} --format="value(managedService)", and then run gcloud services enable {managed_service} --project={project_id}. Also enable it in each project that creates API keys for the API.

    • Use a new config ID for each change, because you cannot change the spec of an existing API config.

    • Run one api-configs create at a time for each API, and wait for it to finish. A large API config can take up to ten minutes to create.

    • If api-configs create fails, find the error text in API Config Errors, fix the spec, and go back to step 3.

    • Keep the previous API config until the new one serves traffic. To roll back, run gateways update with the previous config ID.

  6. Verify the gateway:

    • Run gcloud api-gateway gateways describe {gateway_id} --location={region} --project={project_id} --format="value(state,defaultHostname)", and wait until the state is ACTIVE.

    • Send a request to each changed path at https://{default_hostname}{base_path}{path}, with the credential that the operation requires. Check that the backend receives the path and parameters that you expect.

    • An HTML 404 Page not found means that the gateway is not ready. Check that the last create or update finished, and retry before you change the config. During a gateway update, some requests can still reach the previous API config. A JSON 404 (The current request is not defined by this API.) means that the active API config does not define the path.

Pre-Deployment Checklist

  • [ ] openapi is 3.0.x or 3.1.x, and the spec has no OpenAPI 2.0 extension, such as x-google-management, x-google-endpoints, x-google-api-name, x-google-allow, or x-google-issuer on a security scheme.

  • [ ] x-google-api-management.backends defines every backend, every x-google-backend is a string that names one, and no path item sets x-google-backend.

  • [ ] Every backend sets pathTranslation.

  • [ ] Every operation has a unique operationId and a responses object, and each path variable has a parameter with in: path and required: true.

  • [ ] Every x-google-quota is on an operation that requires an API key, and every metric name matches the current API config.

  • [ ] At most one servers entry has x-google-endpoint, and its URL has no custom port.

  • [ ] python3 scripts/validate_apigw_openapi.py --spec={spec_file} returns "status": "PASS" (exit code 0).

Resource Cleanup

To avoid ongoing charges when you tear down a test environment, request human approval, and delete the resources in dependency order:

gcloud api-gateway gateways delete {gateway_id} --location={region} --project={project_id}
gcloud api-gateway api-configs delete {config_id} --api={api_id} --project={project_id}
gcloud api-gateway apis delete {api_id} --project={project_id}

Files

references/openapi-3-extensions-and-limits.md

OpenAPI 3.x Extensions and Limits in API Gateway

  • New Spec Template: Lines 11-69

  • x-google-api-management: Lines 71-85

  • Backends: Lines 87-113

  • Security: Lines 115-145

  • Quotas: Lines 147-157

  • Servers, Base Path, and CORS: Lines 159-167

  • Paths, Operations, and Schemas: Lines 169-183

New Spec Template

Replace each {placeholder}. The template has a Cloud Run backend, an API key on every operation, and one quota.

openapi: 3.0.4
info:
  title: "{api_title}"
  version: 1.0.0
servers:
  - url: /v1
    x-google-endpoint: {}
x-google-api-management:
  backends:
    main-backend:
      address: "https://{cloud_run_service_url_host}"
      pathTranslation: APPEND_PATH_TO_ADDRESS
  metrics:
    read-requests:
      displayName: Read requests
  quota:
    limits:
      read-limit:
        metric: read-requests
        values: 600
x-google-backend: main-backend
security:
  - api_key: []
components:
  securitySchemes:
    api_key:
      type: apiKey
      name: x-api-key
      in: header
paths:
  /items/{itemId}:
    get:
      operationId: getItem
      summary: Get one item by ID.
      x-google-quota:
        read-requests: 1
      parameters:
        - name: itemId
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: The item.

With this template, a request to /v1/items/42 reaches the backend as /v1/items/42, because APPEND_PATH_TO_ADDRESS keeps the base path. The Cloud Run service must serve the /v1 paths.

API keys work only after you enable the managed service of the API:

  1. Get the name of the managed service with gcloud api-gateway apis describe {api_id} --project={project_id} --format="value(managedService)".

  2. Run gcloud services enable {managed_service} --project={project_id}.

  3. Enable the managed service also in each project that creates API keys for the API. Rationale: API Gateway rejects an API key unless the API is enabled in the project that created the key.

x-google-api-management

Put this required extension at the root of the spec.

FieldRequiredUse
backendsYesA map from each backend name to its settings. See Backends.
metricsNoA map from each quota metric name to {displayName}. See Quotas.
quotaNolimits: a map from each limit name to {metric, values}. See Quotas.
apiNameNoA name for the operations in this document: a lowercase letter, then at most 39 lowercase letters or digits, such as orders. API Gateway also accepts a dotted name of at most 40 characters, such as example.orders. API Gateway rejects two documents in one API config with the same apiName and the same major info.version. A document without apiName uses the name of the managed service, so give each document of an API config its own apiName.
mcpNoEnables MCP tools. Use the api-gateway-mcp-server skill.
aiNoModel routing. An API config cannot have both MCP and model routing. It also cannot have model-routing operations and other operations, in one file or across files.
modelRouterNoThe default model router of the API, for a request without an operation-level x-google-model-router.

API Gateway rejects the whole block if it has another field, such as the OpenAPI 2.0 field unit on a quota limit.

Backends

FieldDefaultRules
addressNoneRequired. An https:// or http:// URL with a fully qualified hostname. API Gateway rejects an IP address, localhost, a metadata server, an .internal hostname, and a hostname segment longer than 63 characters.
jwtAudienceThe full address, with its pathThe audience of the Google ID token that the gateway sends to the backend. Set it to the OAuth client ID for an App Engine or IAP backend. For a Cloud Run address that has a path, set it to the service URL without the path, because Cloud Run expects its service URL.
disableAuthfalseSet true only for a backend that does not check tokens. Then the gateway sends no ID token. Set only one of jwtAudience and disableAuth.
pathTranslationAPPEND_PATH_TO_ADDRESS for a root x-google-backend, CONSTANT_ADDRESS for an operation-level oneAlways set it. If the root and an operation reference one backend without pathTranslation, each reference uses its own default.
deadline15.0Seconds to wait for a full response. Some gateways reject a value above 600 when you create or update the gateway. A streaming gateway accepts up to 3600.
protocolhttp/1.1http/1.1 or h2. Use h2 only with an https:// address. gRPC needs h2, and WebSockets need http/1.1.

Path translation examples:

pathTranslationaddressServer urlRequestBackend request
APPEND_PATH_TO_ADDRESShttps://inventory-abc123-uc.a.run.appnone/items/42https://inventory-abc123-uc.a.run.app/items/42
APPEND_PATH_TO_ADDRESShttps://inventory-abc123-uc.a.run.app/v1/v1/items/42https://inventory-abc123-uc.a.run.app/v1/items/42
CONSTANT_ADDRESShttps://us-central1-{project_id}.cloudfunctions.net/getItemnone/items/42https://us-central1-{project_id}.cloudfunctions.net/getItem?itemId=42

The OpenAPI path in each row is /items/{itemId}.

  • Use APPEND_PATH_TO_ADDRESS for a backend that routes by path, such as a Cloud Run service, a GKE service, or an App Engine app. The backend gets the full request path, with the base path.

  • Use CONSTANT_ADDRESS for a backend that serves one operation at a fixed URL, such as a Cloud Run function.

  • Set x-google-backend at the root or on an operation, never on a path item. Rationale: API Gateway rejects x-google-backend at the path level.

  • For a Cloud Run backend that requires authentication, keep the default token, and grant the gateway service account the Cloud Run Invoker role (roles/run.invoker) on the service.

Reference: OpenAPI 3.x extensions: Backends

Security

JWT scheme fields (x-google-auth in a type: oauth2 security scheme):

FieldRules
issuerThe iss claim of the token, such as https://accounts.google.com for Google ID tokens or https://securetoken.google.com/{firebase_project_id} for Firebase.
jwksUriRequired, also in a scheme that no operation uses. The URL of the public keys, in JWK set or X509 format, such as https://www.googleapis.com/oauth2/v3/certs for Google ID tokens. API Gateway applies the same hostname rules as for a backend address.
audiencesA YAML list of the accepted aud values.
jwtLocationsA list of {header, valuePrefix} or {query} entries. By default, API Gateway reads the token from the Authorization: Bearer header, the X-Goog-Iap-Jwt-Assertion header, or the access_token query parameter.

Give the scheme an OAuth flow, such as flows: {implicit: {authorizationUrl: "", scopes: {}}}. API Gateway reads the JWT settings only from x-google-auth. It adds a JWT provider for every oauth2 scheme, also for a scheme that no operation uses, and it rejects a provider without jwksUri. Remove the oauth2 schemes that you do not use, such as documentation-only schemes from a converter.

API key scheme: type: apiKey with in: header and name: x-api-key, or with in: query and name: key or api_key. API Gateway ignores every other API key scheme, with only a warning. Then an operation that requires only that scheme accepts calls without a key.

Security requirement rules:

RuleExample
AND of an API key and a JWT is supported.security: [{api_key: [], firebase: []}]
AND of two JWT schemes is not supported.Do not write security: [{firebase: [], google_id_token: []}].
OR of JWT schemes is supported.security: [{firebase: []}, {google_id_token: []}]
OR is supported only if every alternative has the API key, or none has it.security: [{api_key: [], firebase: []}, {api_key: [], google_id_token: []}]. Do not write security: [{firebase: []}, {api_key: []}].
Optional security ({}) works only for an API key.security: [{api_key: []}, {}]
Every named scheme must exist in components.securitySchemes.API Gateway rejects the API config otherwise.
  • The root security list applies to every operation that does not set its own security. To remove the root requirement from one operation, set security: [] on it.

  • API Gateway does not check OAuth scopes. Check scopes in the backend.

  • API Gateway checks the token claims against the scheme. It does not check the IAM roles of the caller. A Google ID token scheme accepts every caller that can get a token with an accepted audience. To accept only some callers, check the claims in the backend: API Gateway forwards the JWT payload in the X-Apigateway-Api-Userinfo header.

Reference: OpenAPI 3.x feature limitations

Quotas

  1. Define each metric in x-google-api-management.metrics, such as read-requests: {displayName: Read requests}.

  2. Define each limit in x-google-api-management.quota.limits, such as read-limit: {metric: read-requests, values: 600}. values is the number of requests per minute for each consumer Google Cloud project. Give each metric that an operation uses a limit, because API Gateway rejects a charged metric without a limit.

  3. Set x-google-quota: {read-requests: 1} on each operation that counts against the metric. The value is the cost of one request. Rationale: in OpenAPI 3.x, API Gateway ignores x-google-quota at the root or path level, without an error, even where a documentation example shows it at the root.

  4. Require an API key in every security alternative of each operation that has x-google-quota. Rationale: API Gateway uses the API key to identify the consumer project that the quota counts.

  5. Keep the metric and limit names the same in every API config of the API. Rationale: metrics and limits apply to the whole API, and the newest API config replaces them. If you rename or remove a metric, a gateway that still serves an older API config returns HTTP 500 (Failed to call Service Control Quota) on its quota-enforced operations.

For per-consumer limits, consumer overrides, and HTTP 429 handling, use the api-gateway-backend-security-and-rate-limiting skill if it is installed.

Reference: Quotas apply to the whole API

Servers, Base Path, and CORS

  • Put x-google-endpoint on one servers entry. Its URL path is the base path of the API. Rationale: API Gateway permits only one such entry, and it ignores every servers entry without x-google-endpoint. With no such entry, the API has no base path.

  • Use a relative URL, such as url: /v1. If the API has a managed service that you chose, and not the default *.apigateway.{project_id}.cloud.goog service, use url: https://{managed_service}/v1. Rationale: API Gateway reads the service name from the URL host for such an API.

  • A relative URL must start with /. Do not set url to null, and do not use a custom port or a server variable such as {region}. Rationale: API Gateway rejects these URLs. An empty url or / gives no base path.

  • If an API config has several OpenAPI files, give each file a server with the same x-google-endpoint settings and the same host, and give each file its own apiName. The base path can differ.

  • allowCors: true makes API Gateway pass CORS requests, including preflight OPTIONS requests, to the backend. API Gateway does not add CORS headers. Make the backend answer each preflight request and add the CORS response headers.

Reference: OpenAPI 3.x feature limitations: Servers

Paths, Operations, and Schemas

  • Give every operation a unique operationId and a responses object. API Gateway removes the characters other than letters, digits, and underscores from each operationId, and capitalizes the first letter. The results must also be unique. For example, getItem and GetItem conflict, but get_item and getItem do not.

  • Make each path variable a whole segment, such as /items/{itemId}. API Gateway rejects a partial segment, such as /items/prefix_{id} or /{a}{b}.

  • Give each path variable a parameter with in: path and required: true.

  • Start each variable name with a letter, and use only letters, digits, underscores, dots, and dashes, with at most 30 characters. Use at most 15 path parameters in a path. Keep the names unique after API Gateway converts them to snake_case: bookId and book_id conflict. Keep each path at 512 characters or less.

  • For a variable that matches several segments, write {name} and set x-google-parameter: {pattern: "**"} on the parameter. Use it only on the last segment of the path. OpenAPI 3.x rejects {name=*} and {name=**}.

  • Give each schema one type. API Gateway rejects an OpenAPI 3.1 type list, such as type: ["string", "null"]. In OpenAPI 3.0, use nullable: true for a field that can be null.

  • Use a primitive type or an array of a primitive type for a request parameter. API Gateway rejects an object parameter.

  • API Gateway does not check required parameters, parameter types, request bodies, or content types. It forwards each request to the backend, so the backend must validate the input.

  • Use local references, such as $ref: "#/components/schemas/Item". API Gateway rejects a $ref to a URL. Keep the schemas in the same file.

  • Use $ref instead of YAML anchors and aliases. API Gateway rejects an alias to a mapping, and the error (string found, object expected) does not name the alias.

  • Keep the files of one API config at 10 MB in total, and at most 50 files.

Reference: OpenAPI 3.x feature limitations and Path templating

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs an API key, Needs a command-line tool, Needs Python

Security

What our scanner noticed· Low risk

  • Instructions that use the network
  • Scripts that your agent may run

This skill includes scripts that your agent may run. Read them before you use it.

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
Google
Publisher
Google (Official)
Source
google/skills · skills/cloud/api-gateway-openapi-spec-authoring · commit 2194d3b
Licence
Apache License 2.0 (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Google or Google.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download api-gateway-openapi-spec-authoring.zip