Swagger 招摇过市:重复的映射键定义

Swagger 招摇过市:重复的映射键定义,swagger,Swagger,您好,我是一个非常新的招摇过市和我的生活,我无法找到如何修复这个错误的代码。我不断得到一个重复的映射键,它位于下面链接的代码底部 /channels/{country_code}/{category_slug}: get: tags: - "Channels" summary: Get a list of all channels that a company has added to spotlight for a given category description: "Th

您好,我是一个非常新的招摇过市和我的生活,我无法找到如何修复这个错误的代码。我不断得到一个重复的映射键,它位于下面链接的代码底部

/channels/{country_code}/{category_slug}:
get:
  tags:
  - "Channels"
  summary: Get a list of all channels that a company has added to spotlight for a given category
  description: "This GET will return a list of all channels which are aviable to your API key and Category"
  operationID: "channels_slug_GET"
  parameters:
  - name: "country_code"
    in: "path"
    description: "The country the user is located in (retrievable via Geolocation service call)"
    required: true
    type: "string"
  - name: "category_slug"
    in: "path"
    description: "the category the channel(s) belong to"
    required: true
    type: "string"
  - name: "detail"
    in: "query"
    description: "As channel objects are fairly large, an optional parameter detail is introduced to most Spotlight API calls. It has two possible values - lean and partial.\n lean - specifying lean will return just the _id,title,slug, description, company, company_logo,poster, spotlight_poster,videos_thumb properties for a channel.\npartial - specifying partial will return the lean data for the channel plus limited data for the channel's video, playlist, and child channels"
    required: false
    type: "string"
  - name: "token"
    in: "query"
    description: "Your API access token (see /token route)"
    required: true
    type: "string"
  responses:
    200:
      description: "List of all available channels"
      schema:
        type: "array"
        items:
          $ref: "#/definitions/Channel"
    default:
      description: "Unexpected error"
      schema:
        $ref: "#/definitions/Error"

您可能在YAML中多次声明了以下url

"/channels/{country_code}/{category_slug}:"

我知道这是一个老问题,但无论如何…复制并粘贴你的yml文件内容到[swagger editor]()。它会告诉你你的文件有什么问题,你可以从那里调试。