Documentation
¶
Overview ¶
Package contracttest checks HTTP exchanges against the public contract, api/openapi.yaml. Handler tests use it to prove that what the API really answers is what the contract says.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUndocumented = errors.New("operation not in the contract")
ErrUndocumented means the contract has no operation for the request's method and path.
Functions ¶
This section is empty.
Types ¶
type Contract ¶
type Contract struct {
// contains filtered or unexported fields
}
Contract is the public contract, ready to check exchanges against.
func Load ¶
Load reads and validates the contract of package api. In its copy, every object schema of a response rejects undocumented properties: clients must ignore the fields they do not know, but the API must not send any. Request schemas stay open.
Click to show internal directories.
Click to hide internal directories.