如何在openapi-generator中获取不同组的参数

How to get parameters in different groups in openapi-generator

我是 openapi-generator 的新手。

我的部分 yaml 文件如下所示。在生成器中(在小胡子文件中)我可以使用 allParams 获取所有参数,它将 return

ChannelTimezoneNameHeader,
LanguageHeader,

goalId,
customerId

我的问题是如何分别获取第一类参数和第二类参数,而不是合并在一起?

/accounts/customer/{customerId}/goals/{goalId}/transactions:
      x-swagger-router-controller: "GoalsController"
      parameters:
        -
          $ref: "#/parameters/ChannelTimezoneNameHeader"
        -
          $ref: "#/parameters/LanguageHeader"
      get:
        tags:
          - "goals"
        summary: "get goal transactions for a customer account"
        description: ""
        operationId: "getGoalTransactions"
        security:
          -
            AuthorizationHeader: []
            XIdTokenHeader: []
        parameters:
          -
            name: "goalId"
            in: "path"
            description: "goalId"
            required: true
            type: "string"
          -
            name: "customerId"
            in: "path"
            description: "customerId"
            required: true
            type: "string"
        responses:
          200:
            description: "successful operation"
            schema:
              $ref: "#/definitions/TransactionListGoal"
          400:
            description: "Bad Request"
            schema:
              $ref: "#/definitions/ChannelApiError"
          500:
            description: "Server error"
            schema:
              $ref: "#/definitions/ChannelApiError"

我认为您正在寻找以下小胡子标签:

{{#queryParams}} ... {{/queryParams}}

{{#formParams}} ... {{/formParams}}

{{#headerParams}} ... {{/headerParams}}

{{#pathParams}} ... {{/pathParams}}

{{#bodyParams}} ... {{/bodyParams}}