Closed loretoparisi closed 8 years ago
Thank you for trying. This is a template.
# this is an example of the Uber API
# as a demonstration of an API spec in YAML
swagger: '2.0'
info:
title: YOUR_API_TITLE
description: YOUR_API_DESCRIPTION
version: "1.0.0"
# the domain of the service
host: localhost
# array of all schemes that your API supports
schemes:
- http
basePath: /
produces:
- application/json
paths:
###########################
# Paste from here
###########################
And I have some bugs currenty version in array.
So, I fix your json like below.
/v1/search:
get:
summary: ""
description: ""
parameters:
-
name: "q"
type: "string"
in: "query"
description: ""
required: true
-
name: "type"
type: "string"
in: "query"
description: ""
required: true
responses:
200:
description: ""
schema:
type: "object"
properties:
artists:
type: "object"
properties:
href:
type: "string"
description: ""
items:
type: "array"
items:
type: "object"
properties:
external_urls:
type: "object"
properties:
spotify:
type: "string"
description: ""
genres:
type: "array"
items:
type: "undefined"
description: ""
href:
type: "string"
description: ""
id:
type: "string"
description: ""
images:
type: "array"
items:
properties:
type: "object"
properties:
height:
type: "number"
description: ""
url:
type: "string"
description: ""
width:
type: "number"
description: ""
name:
type: "string"
description: ""
popularity:
type: "number"
description: ""
type:
type: "string"
description: ""
uri:
type: "string"
description: ""
limit:
type: "number"
description: ""
next:
type: "object"
items:
properties: {}
offset:
type: "number"
description: ""
previous:
type: "object"
items:
properties: {}
total:
type: "number"
description: ""
This is so good sample request, I'll use this for generating acutual format.
Thanks!
@moongift great, happy to help this is a great project! I will wait the fix then.
@moongift thank you now it works correctly.
I have followed the tutorial, generating the
YAML
from a cURL command and its json response. When I try to import the resultingYAML
in the Swagger Editor, I get several errors:etc.
I have tried the Spotify Web API here:
and
json
The result from cURLToSwagger is
I didn't use any custom options, and left all the checkmarks checked.
If I try the example
YAML
output in the Swagger editor, I can import/export the yaml format without errors. Any hint?