github.com/circl-dev/go-swagger@v0.31.0/examples/external-types/README.md (about) 1 # External types examples 2 3 The sample specification provided here demonstrates how to bind your generated API 4 with some externally defined types for schemas. 5 6 This [swagger specification](./example-external-types.yaml) illustrates the following use cases: 7 8 1. refer to an external type imported from some external package, as its own definition 9 2. refer to an external type imported from some external package, as part of another type (object, slice, map or tuple) 10 3. refer to an external type imported from the default location of models (i.e. besides generated models) 11 4. embed external type to add the Validatable interface. 12 5. use hints in annotations to solve nullable/struct vs interface issues 13 6. use hints in annotations to skip the validation of external types 14 15 > NOTE: due to the addition of the "additionalItems" clause to illustrate tuples, the spec is not formally 16 > valid against the swagger 2.0 schema. 17 18 [Reference documentation](../../docs/use/models/schemas.md#external-types)