/
docs.go
76 lines (67 loc) · 1.7 KB
/
docs.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// Package classification of Product API
//
// Documentation for Product API
//
// Schemes: http
// BasePath: /
// Version: 1.0.0
//
// Consumes:
// - application/json
//
// Produces:
// - application/json
//
// swagger:meta
package handlers
import "github.com/PacktPublishing/Building-Microservices-with-Go-Second-Edition/product-api/8_validation/data"
//
// NOTE: Types defined here are purely for documentation purposes
// these types are not used by any of the handers
// Generic error message returned as a string
// swagger:response errorResponse
type errorResponseWrapper struct {
// Description of the error
// in: body
Body GenericError
}
// Validation errors defined as an array of strings
// swagger:response errorValidation
type errorValidationWrapper struct {
// Collection of the errors
// in: body
Body ValidationError
}
// A list of products
// swagger:response productsResponse
type productsResponseWrapper struct {
// All current products
// in: body
Body []data.Product
}
// Data structure representing a single product
// swagger:response productResponse
type productResponseWrapper struct {
// Newly created product
// in: body
Body data.Product
}
// No content is returned by this API endpoint
// swagger:response noContentResponse
type noContentResponseWrapper struct {
}
// swagger:parameters update create
type productParamsWrapper struct {
// Product data structure to Update or Create.
// Note: the id field is ignored by update and create operations
// in: body
// required: true
Body data.Product
}
// swagger:parameters listSingle delete
type productIDParamsWrapper struct {
// The id of the product for which the operation relates
// in: path
// required: true
ID int `json:"id"`
}