Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex API Gateway
  • Getting started
    • Resource relationships
    • Networking
      • Overview
      • Greedy parameters
      • Generic HTTP method
      • Authorization using a Cloud Functions function
      • Authorization using a JWT
      • WebSocket protocol support
      • Data validation
      • CORS
      • Specification parameterization
      • Canary release
      • Request rate limit
      • Response code replacement
      • Transformation of response and request bodies
    • Quotas and limits
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes
  • FAQ

In this article:

  • x-yc-apigateway:variables extension
  • VariableObject
  • Usage
  • Extension specification
  • Use cases
  1. Concepts
  2. Specification extensions
  3. Specification parameterization

Specification parameterization

Written by
Yandex Cloud
Updated at April 18, 2025
  • x-yc-apigateway:variables extension
    • VariableObject
    • Usage
    • Extension specification
  • Use cases

With specification parameterization, you can change the way API Gateway works by setting different values for individual variables rather than the entire specification. For this, you can use the x-yc-apigateway:variables extension.

x-yc-apigateway:variables extensionx-yc-apigateway:variables extension

The x-yc-apigateway:variables extension allows you to declare variables that are used for specification parameterization.

VariableObjectVariableObject

VariableObject is a set of OpenAPI specification parameters that define a variable and its possible values.

ParametersParameters

The table below lists the VariableObject parameters.

Parameter Type Required Description
default string, int, double, boolean Yes Default variable value. It is used if the enum parameter is not specified.
enum string[], int[], double[], boolean[] No List of acceptable variable values. If it is not specified, the variable may take any value.
description string No Text description of the variable.

UsageUsage

After you declare the variable, you can use a ${var.name} statement further in the specification, where name is the name of the variable. API Gateway will replace the variable name with the value you set when creating or updating an API gateway, if required.

Extension specificationExtension specification

Extension specification example:

openapi: 3.0.0
info:
  title: Sample API
  version: 1.0.0

x-yc-apigateway:
  variables:
    environment:
      default: "prod"
      enum:
        - "prod"
        - "testing"
        - "dev"
      description: "API Gateway installation"

paths:
  /env/info:
    get:
      x-yc-apigateway-integration:
        type: dummy
        content:
          '*': It is ${var.environment} environment!
        http_code: 200
        http_headers:
          Content-Type: text/plain

Use casesUse cases

  • Canary release of a Cloud Functions function

Was the article helpful?

Previous
CORS
Next
Canary release
© 2025 Direct Cursus Technology L.L.C.