-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/1.1' into main
- Loading branch information
Showing
11 changed files
with
586 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,185 @@ | ||
// 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" | ||
) | ||
|
||
var doc = `{ | ||
"schemes": {{ marshal .Schemes }}, | ||
"swagger": "2.0", | ||
"info": { | ||
"description": "{{.Description}}", | ||
"title": "{{.Title}}", | ||
"contact": {}, | ||
"version": "{{.Version}}" | ||
}, | ||
"host": "{{.Host}}", | ||
"basePath": "{{.BasePath}}", | ||
"paths": { | ||
"/arrays": { | ||
"post": { | ||
"description": "Serves the /arrays resource POST requests by receiving a JSON object with an unsorted numbers array and responds with a JSON object with that array and its sorted version", | ||
"consumes": [ | ||
"application/json" | ||
], | ||
"produces": [ | ||
"application/json" | ||
], | ||
"summary": "Serves the /arrays resource POST requests", | ||
"parameters": [ | ||
{ | ||
"description": "The unsorted array of numbers", | ||
"name": "unsorted", | ||
"in": "body", | ||
"required": true, | ||
"schema": { | ||
"$ref": "#/definitions/arrays.ArraysJSON" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"schema": { | ||
"type": "string" | ||
} | ||
}, | ||
"400": { | ||
"description": "Bad Request", | ||
"schema": { | ||
"type": "string" | ||
} | ||
}, | ||
"405": { | ||
"description": "Method Not Allowed", | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/users": { | ||
"get": { | ||
"description": "Renders the index.html template for the /users resource, showing all users and a form to query a user", | ||
"produces": [ | ||
"text/html" | ||
], | ||
"summary": "Serves the /users resource", | ||
"operationId": "get-all-users", | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/users/{id}": { | ||
"get": { | ||
"description": "Renders the user.html template for the /users/{id} resource, showing the user by specified path variable {id}", | ||
"produces": [ | ||
"text/html" | ||
], | ||
"summary": "Serves the /users/{id} resource,", | ||
"operationId": "get-user-by-id", | ||
"parameters": [ | ||
{ | ||
"type": "integer", | ||
"description": "User ID", | ||
"name": "id", | ||
"in": "path", | ||
"required": true | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"schema": { | ||
"type": "string" | ||
} | ||
}, | ||
"500": { | ||
"description": "" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"definitions": { | ||
"arrays.ArraysJSON": { | ||
"type": "object", | ||
"properties": { | ||
"sorted": { | ||
"type": "array", | ||
"items": { | ||
"type": "integer" | ||
} | ||
}, | ||
"unsorted": { | ||
"type": "array", | ||
"items": { | ||
"type": "integer" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}` | ||
|
||
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: "1.0", | ||
Host: "localhost:8080", | ||
BasePath: "/", | ||
Schemes: []string{}, | ||
Title: "Jikko-Golang REST API", | ||
Description: "This is an example Web server that sorts arrays and displays user info", | ||
} | ||
|
||
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() | ||
} | ||
|
||
func init() { | ||
swag.Register(swag.Name, &s{}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
{ | ||
"swagger": "2.0", | ||
"info": { | ||
"description": "This is an example Web server that sorts arrays and displays user info", | ||
"title": "Jikko-Golang REST API", | ||
"contact": {}, | ||
"version": "1.0" | ||
}, | ||
"host": "localhost:8080", | ||
"basePath": "/", | ||
"paths": { | ||
"/arrays": { | ||
"post": { | ||
"description": "Serves the /arrays resource POST requests by receiving a JSON object with an unsorted numbers array and responds with a JSON object with that array and its sorted version", | ||
"consumes": [ | ||
"application/json" | ||
], | ||
"produces": [ | ||
"application/json" | ||
], | ||
"summary": "Serves the /arrays resource POST requests", | ||
"parameters": [ | ||
{ | ||
"description": "The unsorted array of numbers", | ||
"name": "unsorted", | ||
"in": "body", | ||
"required": true, | ||
"schema": { | ||
"$ref": "#/definitions/arrays.ArraysJSON" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"schema": { | ||
"type": "string" | ||
} | ||
}, | ||
"400": { | ||
"description": "Bad Request", | ||
"schema": { | ||
"type": "string" | ||
} | ||
}, | ||
"405": { | ||
"description": "Method Not Allowed", | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/users": { | ||
"get": { | ||
"description": "Renders the index.html template for the /users resource, showing all users and a form to query a user", | ||
"produces": [ | ||
"text/html" | ||
], | ||
"summary": "Serves the /users resource", | ||
"operationId": "get-all-users", | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/users/{id}": { | ||
"get": { | ||
"description": "Renders the user.html template for the /users/{id} resource, showing the user by specified path variable {id}", | ||
"produces": [ | ||
"text/html" | ||
], | ||
"summary": "Serves the /users/{id} resource,", | ||
"operationId": "get-user-by-id", | ||
"parameters": [ | ||
{ | ||
"type": "integer", | ||
"description": "User ID", | ||
"name": "id", | ||
"in": "path", | ||
"required": true | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"schema": { | ||
"type": "string" | ||
} | ||
}, | ||
"500": { | ||
"description": "" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"definitions": { | ||
"arrays.ArraysJSON": { | ||
"type": "object", | ||
"properties": { | ||
"sorted": { | ||
"type": "array", | ||
"items": { | ||
"type": "integer" | ||
} | ||
}, | ||
"unsorted": { | ||
"type": "array", | ||
"items": { | ||
"type": "integer" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.