Skip to content

Commit

Permalink
docs: regenerate
Browse files Browse the repository at this point in the history
  • Loading branch information
mgjules committed Apr 11, 2022
1 parent 002cf1e commit c285187
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 58 deletions.
71 changes: 18 additions & 53 deletions docs/docs.go
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// Package docs GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag

package docs

import (
"bytes"
"encoding/json"
"strings"

"github.com/alecthomas/template"
"github.com/swaggo/swag"
)
import "github.com/swaggo/swag"

var doc = `{
const docTemplate = `{
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
"description": "{{.Description}}",
"description": "{{escape .Description}}",
"title": "{{.Title}}",
"contact": {
"name": "Jules Michael"
Expand Down Expand Up @@ -299,6 +291,10 @@ var doc = `{
"description": "The number of the track. If an album has several\ndiscs, the track number is the number on the specified\nDiscNumber.",
"type": "integer"
},
"type": {
"description": "Type of the track",
"type": "string"
},
"uri": {
"type": "string"
}
Expand Down Expand Up @@ -465,49 +461,18 @@ var doc = `{
}
}`

type swaggerInfo struct {
Version string
Host string
BasePath string
Schemes []string
Title string
Description string
}

// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = swaggerInfo{
Version: "0.1.0",
Host: "",
BasePath: "",
Schemes: []string{},
Title: "Spoty API",
Description: "Access information about current playing track on spotify through REST endpoints.",
}

type s struct{}

func (s *s) ReadDoc() string {
sInfo := SwaggerInfo
sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1)

t, err := template.New("swagger_info").Funcs(template.FuncMap{
"marshal": func(v interface{}) string {
a, _ := json.Marshal(v)
return string(a)
},
}).Parse(doc)
if err != nil {
return doc
}

var tpl bytes.Buffer
if err := t.Execute(&tpl, sInfo); err != nil {
return doc
}

return tpl.String()
var SwaggerInfo = &swag.Spec{
Version: "0.1.0",
Host: "",
BasePath: "",
Schemes: []string{},
Title: "Spoty API",
Description: "Access information about current playing track on spotify through REST endpoints.",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
}

func init() {
swag.Register(swag.Name, &s{})
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}
4 changes: 4 additions & 0 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,10 @@
"description": "The number of the track. If an album has several\ndiscs, the track number is the number on the specified\nDiscNumber.",
"type": "integer"
},
"type": {
"description": "Type of the track",
"type": "string"
},
"uri": {
"type": "string"
}
Expand Down
18 changes: 13 additions & 5 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ definitions:
properties:
album:
$ref: '#/definitions/spotify.SimpleAlbum'
description: The album on which the track appears. The album object includes a link in href to full information about the album.
description: The album on which the track appears. The album object includes
a link in href to full information about the album.
artists:
items:
$ref: '#/definitions/spotify.SimpleArtist'
Expand All @@ -31,7 +32,8 @@ definitions:
type: string
type: array
disc_number:
description: The disc number (usually 1 unless the album consists of more than one disc).
description: The disc number (usually 1 unless the album consists of more
than one disc).
type: integer
duration_ms:
description: The length of the track, in milliseconds.
Expand All @@ -52,7 +54,8 @@ definitions:
description: External URLs for this track.
type: object
href:
description: A link to the Web API endpoint providing full details for this track.
description: A link to the Web API endpoint providing full details for this
track.
type: string
id:
type: string
Expand Down Expand Up @@ -84,6 +87,9 @@ definitions:
discs, the track number is the number on the specified
DiscNumber.
type: integer
type:
description: Type of the track
type: string
uri:
type: string
type: object
Expand Down Expand Up @@ -180,7 +186,8 @@ definitions:
to a time.Time value.
type: string
release_date_precision:
description: 'The precision with which ReleaseDate value is known: "year", "month", or "day"'
description: 'The precision with which ReleaseDate value is known: "year",
"month", or "day"'
type: string
uri:
description: The SpotifyURI for the album.
Expand Down Expand Up @@ -221,7 +228,8 @@ definitions:
info:
contact:
name: Jules Michael
description: Access information about current playing track on spotify through REST endpoints.
description: Access information about current playing track on spotify through REST
endpoints.
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
Expand Down

0 comments on commit c285187

Please sign in to comment.