ApiVersion Configuration

Configure API versions with authentication and connection settings

ApiVersion Configuration

Defines a specific version of an API with its authentication, connection settings, and parameters.

Schema Properties

PropertyTypeRequiredDefaultDescription
ApiNamestringYes-Name of the API this version belongs to
IsActiveboolNotrueWhether this API version is active and available for use
ParametersDictionary<string, object>No{}Configuration parameters specific to this API version
AuthenticationApiAuthenticationNonullAuthentication settings for API requests
ConnectionConnectionSettingsNoDefault settingsHTTP connection configuration
VariablesDictionary<string, string>No{}Variables that can be referenced in API operations

Authentication Properties

PropertyTypeRequiredDefaultDescription
TypestringYes-Authentication type (e.g., “Bearer”, “Basic”, “ApiKey”)
ParametersDictionary<string, object>No{}Authentication-specific parameters

Connection Properties

PropertyTypeRequiredDefaultDescription
UseProxyboolNofalseWhether to use a proxy for connections
AllowAutoRedirectboolNofalseWhether to automatically follow HTTP redirects
AutomaticDecompressionDecompressionMethodsNoNoneDecompression methods to use (None, GZip, Deflate, Brotli)
UseCookiesboolNofalseWhether to handle cookies automatically
ConnectTimeoutTimeSpanNo00:00:15Connection timeout duration

YAML Example

apiVersion: weik.io/v1
kind: ApiVersion
metadata:
  name: northwind-v1
spec:
  ApiName: northwind-api
  IsActive: true
  Parameters:
    BaseUrl: https://api.example.com/v1
    RetryCount: 3
    Timeout: 30
  Authentication:
    Type: Bearer
    Parameters:
      TokenEndpoint: https://auth.example.com/token
      ClientId: my-client-id
      Scope: api.read api.write
  Connection:
    UseProxy: false
    AllowAutoRedirect: true
    AutomaticDecompression: GZip
    UseCookies: true
    ConnectTimeout: 00:00:30
  Variables:
    Environment: production
    Region: us-east-1

Usage Notes

Use ApiVersion configuration to define different versions of an API with version-specific settings. Each version can have its own authentication method, connection settings, and parameters.

The Authentication.Type determines which authentication mechanism to use. Common values include:

  • Bearer - OAuth 2.0 Bearer token authentication
  • Basic - HTTP Basic authentication
  • ApiKey - API key in header or query parameter
  • OAuth2 - Full OAuth 2.0 flow

The Connection settings control HTTP client behavior. Set AutomaticDecompression to handle compressed responses, and adjust ConnectTimeout based on your API’s response characteristics.

Variables defined at the version level can be referenced throughout the API configuration using the ${variableName} syntax.