Discover Packages
github.com/circl-dev/go-swagger
examples
external-types
directory
Version:
v0.30.0
Opens a new window with list of versions in this module.
Published: Mar 28, 2022
License: Apache-2.0
Opens a new window with license information.
README
README
¶
External types examples
The sample specification provided here demonstrates how to bind your generated API
with some externally defined types for schemas.
This swagger specification illustrates the following use cases:
refer to an external type imported from some external package, as its own definition
refer to an external type imported from some external package, as part of another type (object, slice, map or tuple)
refer to an external type imported from the default location of models (i.e. besides generated models)
embed external type to add the Validatable interface.
use hints in annotations to solve nullable/struct vs interface issues
use hints in annotations to skip the validation of external types
NOTE: due to the addition of the "additionalItems" clause to illustrate tuples, the spec is not formally
valid against the swagger 2.0 schema.
Reference documentation
Expand ▾
Collapse ▴
Directories
¶
cmd
Package restapi external types imports: external anonymous types This sample specification exercises external types, with both x-go-type in definitions and inlined.
Package restapi external types imports: external anonymous types This sample specification exercises external types, with both x-go-type in definitions and inlined.
Click to show internal directories.
Click to hide internal directories.