Skip to content

{braces} in ServerVariables not getting replaced #1166

@butilka123

Description

@butilka123

Describe the bug

Following this article: https://www.asyncapi.com/docs/concepts/asyncapi-document/variable-url

The Variables in {braces} dont get replaced.

To Reproduce

Steps to reproduce the behavior:

  1. Create a yaml file. (See Sample Document)
  2. Generate the HTML:

asyncapi generate fromTemplate file.yaml @asyncapi/html-template@3.0.0 -o example --use-new-generator

Expected behavior

A Document with replaced {braces}

Sample document

asyncapi: 3.0.0
info:
  title: Example API
  version: '1.0.0'
servers:
  production:
    host: '{subdomain}.example.com:{port}'
    pathname: '/{version}'
    protocol: amqp
    variables:
      subdomain:
        $ref: '#/components/serverVariables/subdomain'
      port:
        $ref: '#/components/serverVariables/port'
      version:
        $ref: '#/components/serverVariables/version'
  development:
    host: '{subdomain}.dev.example.com:{port}'
    pathname: /v1
    protocol: amqp
    variables:
      subdomain:
        $ref: '#/components/serverVariables/subdomain'
      port:
        $ref: '#/components/serverVariables/port'
      version:
        $ref: '#/components/serverVariables/version'
components:
  serverVariables:
    subdomain:
      enum:
        - development
        - staging
        - production
      default: development
    port:
      default: '8080'
    version:
      enum:
        - v1
        - v2

Screenshots

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions