Skip to content

Support variable generation and template expansion in serverURL #24

@czechboy0

Description

@czechboy0

We should support variable expansion in the Server Object: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#server-variable-object

The generated Servers enum already uses static methods to prepare for this:

enum Servers {
  static func server1() throws -> URL
}

Supporting variables would mean generating e.g.

enum Servers {
  static func server2(environment: String, foo: Int, bar: Components.Schemas.Something) throws -> URL
}

Metadata

Metadata

Assignees

Labels

area/generatorAffects: plugin, CLI, config file.area/openapiAdding/updating a feature defined in OpenAPI.kind/featureNew feature.size/MMedium task. (A couple of days of work.)

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions