README
¶
title: Sample API version: 0.0.0
Sample API
paths
| endpoint | operationId | tags | summary |
|---|---|---|---|
GET /users |
main.ListUsers | main |
ListUsers returns a list of users. |
POST /users |
main.InsertUser | main |
InsertUser inserts user. |
GET /users/{userId} |
main.GetUser | main |
GetUser returns user |
main.ListUsers GET /users
ListUsers returns a list of users.
| name | value |
|---|---|
| operationId | main.ListUsers |
| endpoint | GET /users |
| input | Input |
| output | []User | APIError |
| tags | main |
output (application/json)
// GET /users (200)
type Output200 []struct { // User
id integer
// for go-playground/validator
name string
}
// GET /users (default)
// default error
type OutputDefault struct { // APIError
message string
details map[string]struct { // FieldError
path string
message string
}
}
description
ListUsers returns a list of users.
main.InsertUser POST /users
InsertUser inserts user.
| name | value |
|---|---|
| operationId | main.InsertUser |
| endpoint | POST /users |
| input | Input[ User ] |
| output | User | APIError |
| tags | main |
input (application/json)
// POST /users
type Input struct {
JSONBody struct { // User
id integer
// for go-playground/validator
name string
}
}
output (application/json)
// POST /users (200)
type Output200 struct { // User
id integer
// for go-playground/validator
name string
}
// POST /users (default)
// default error
type OutputDefault struct { // APIError
message string
details map[string]struct { // FieldError
path string
message string
}
}
description
InsertUser inserts user.
main.GetUser GET /users/{userId}
GetUser returns user
| name | value |
|---|---|
| operationId | main.GetUser |
| endpoint | GET /users/{userId} |
| input | Input |
| output | User | APIError |
| tags | main |
input (application/json)
// GET /users/{userId}
type Input struct {
userId integer `in:"path"`
}
output (application/json)
// GET /users/{userId} (200)
type Output200 struct { // User
id integer
// for go-playground/validator
name string
}
// GET /users/{userId} (default)
// default error
type OutputDefault struct { // APIError
message string
details map[string]struct { // FieldError
path string
message string
}
}
description
GetUser returns user
schemas
| name | summary |
|---|---|
| APIError | |
| FieldError | |
| User |
APIError
type APIError struct {
message string
details map[string]struct { // FieldError
path string
message string
}
}
- output of main.ListUsers (default) as
APIError - output of main.InsertUser (default) as
APIError - output of main.GetUser (default) as
APIError
FieldError
type FieldError struct {
path string
message string
}
User
type User struct {
id integer
// for go-playground/validator
name string
}
Documentation
¶
There is no documentation for this package.
Click to show internal directories.
Click to hide internal directories.