github.com/josephspurrier/go-swagger@v0.2.1-0.20221129144919-1f672a142a00/fixtures/goparsing/spec/api.go (about) 1 // Package booking API. 2 // 3 // the purpose of this application is to provide an application 4 // that is using plain go code to define an API 5 // 6 // Schemes: https 7 // Host: localhost 8 // Version: 0.0.1 9 // 10 // Consumes: 11 // - application/json 12 // 13 // Produces: 14 // - application/json 15 // 16 // swagger:meta 17 package spec 18 19 import ( 20 "net/http" 21 22 "github.com/go-swagger/scan-repo-boundary/makeplans" 23 ) 24 25 // Customer of the site. 26 // 27 // swagger:model Customer 28 type Customer struct { 29 Name string `json:"name"` 30 } 31 32 // IgnoreMe should not be added to definitions since it is not annotated. 33 type IgnoreMe struct { 34 Name string `json:"name"` 35 } 36 37 // DateRange represents a scheduled appointments time 38 // DateRange should be in definitions since it's being used in a response 39 type DateRange struct { 40 Start string `json:"start"` 41 End string `json:"end"` 42 } 43 44 // BookingResponse represents a scheduled appointment 45 // 46 // swagger:response BookingResponse 47 type BookingResponse struct { 48 // Booking struct 49 // 50 // in: body 51 // required: true 52 Body struct { 53 Booking makeplans.Booking `json:"booking"` 54 Customer Customer `json:"customer"` 55 Dates DateRange `json:"dates"` 56 // example: {"key": "value"} 57 Map map[string]string `json:"map"` 58 // example: [1, 2] 59 Slice []int `json:"slice"` 60 } 61 } 62 63 // Bookings swagger:route GET /admin/bookings/ booking Bookings 64 // 65 // Bookings lists all the appointments that have been made on the site. 66 // 67 // Consumes: 68 // application/json 69 // 70 // Deprecated: true 71 // 72 // Schemes: http, https 73 // 74 // Produces: 75 // application/json 76 // 77 // Responses: 78 // 200: BookingResponse 79 func bookings(w http.ResponseWriter, r *http.Request) { 80 81 }