ignore

swagger:ignore #

Syntax #

swagger:ignore

Example 1: Marks a struct as explicitly ignore from the Swagger spec output #

//swagger: ignore
type Patient struct {
    // example: John Doe
    name        string  `json:"name"`
    // example: 27
    age         int     `json:"age""`
    // example: New York
    city        string  `json:"city"`
    // example: 1234567890
    phone       string  `json:"phone"`
    // example: 1A2B3C
    uniqueId    string  `json:"unique_id"`
}

Example 2: Exclude a specific field from swagger spec output #

//swagger: model Person
type Person struct {
    // example: John Doe
    name        string  `json:"name"`
    // example: 27
    age         int     `json:"age""`
    // example: New York
    city        string  `json:"city"`
    // example: 1234567890
    phone       string  `json:"phone"`
    // example: 1A2B3C
    // swagger: ignore
    uniqueId    string  `json:"unique_id"`
}

Copyright 2015-2024 the go-swagger maintainers. This documentation is under an Apache 2.0 license.

Site built with HUGO using hugo-book