4.55.0

(feat): Add support for server URL templating with OpenAPI server variables. This enables dynamic base URL construction at runtime based on user-provided configuration.

OpenAPI definition example:

1servers:
2 - url: https://api.{region}.{environment}.example.com/v1
3 variables:
4 region:
5 default: us-east-1
6 enum: [us-east-1, us-west-2, eu-west-1]
7 environment:
8 default: prod
9 enum: [prod, staging, dev]

Generated constructor parameters: Server variables are exposed as optional constructor parameters with their default values:

  • region: typing.Optional[str] - defaults to "us-east-1"
  • server_url_environment: typing.Optional[str] - defaults to "prod" (prefixed to avoid shadowing)

Runtime URL interpolation: When server variables are provided, the SDK performs runtime URL template interpolation:

1from seed import SeedApi
2
3# Uses default: https://api.us-east-1.prod.example.com/v1
4client = SeedApi()
5
6# Custom region: https://api.eu-west-1.prod.example.com/v1
7client = SeedApi(region="eu-west-1")
8
9# Custom region and environment: https://api.us-west-2.staging.example.com/v1
10client = SeedApi(region="us-west-2", server_url_environment="staging")

Multiple base URL environments: For APIs with multiple base URLs (e.g., separate base and auth URLs), each URL template is interpolated independently with the same server variables.

x-fern-default-url extension: When present in the OpenAPI spec, this extension specifies which server URL should be used as the default environment, overriding the first server in the list.

4.54.4

(fix): The use_provided_defaults config option no longer applies defaults to inlined request body properties.