【发布时间】:2016-10-21 17:42:16
【问题描述】:
您好,我对 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: "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"
【问题讨论】:
-
我知道这是一个老问题,但无论如何...将您的 yml 文件内容复制并粘贴到 [swagger editor] (editor.swagger.io)。它会告诉您文件有什么问题,您可以从那里进行调试。
标签: swagger