How to specify type for a swagger:parameters struct

Viewed 54

My struct is defined as the following

// swagger:parameters instanceLogs
type SelectorParameter struct {
    // selector
    // in: query
    // required: false
    // type: string
    Selector uint `json:"selector"`
}

However the type show in my generated spec is uint64. Any idea what I'm doing wrong?

1 Answers

You did it correctly, you haven't specified the length of it. so the system has decided about that.

I didn't get what exactly you want set for it, if you want it be integer use just int if you uint32 use uint32

// swagger:parameters instanceLogs
type SelectorParameter struct {
    // selector
    // in: query
    // required: false
    // type: string
    Selector int `json:"selector"`  // it will be Integer
}

what is UINT

Related