Skip to content

Support for Server Variables #596

@AlexanderKomi

Description

@AlexanderKomi

What would you like fabrikt to generate?

Open API Spec defines a server variables section.
Using variables in the url section, causes the generation of the api spec to fail.

The example for server variables is copy-pasted directly from the openapi specification: https://spec.openapis.org/oas/latest.html#server-object-example

Example Spec

servers:
  - url: https://{username}.gigantic-server.com:{port}/{basePath}
    description: The production API server
    name: prod
    variables:
      username:
        # note! no enum here means it is an open value
        default: demo
        description: A user-specific subdomain. Use `demo` for a free sandbox environment.
      port:
        enum:
          - '8443'
          - '443'
        default: '8443'
      basePath:
        # open meaning there is the opportunity to use special base paths as assigned by the provider, default is "v2"
        default: v2

Desired Output

I have no idea what to do with the servers object in the generated code, but I would recommend not crash the rest of the code generation, if nothing else is done with this section.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions