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