Documentation
¶
Index ¶
Constants ¶
const XExtendKey = "x-extend"
XExtendKey is the OpenAPI extension key that signals schema inheritance. When present, the child schema is merged with the parent provided to Extend.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AdditionalProperties ¶
type AdditionalProperties struct{}
AdditionalProperties is a Transformer that sets AdditionalProperties to false on every object schema node that does not already define it. This prevents values documents from containing undeclared keys that would otherwise pass validation silently.
func (*AdditionalProperties) Transform ¶
func (t *AdditionalProperties) Transform(s *spec.Schema) *spec.Schema
Transform sets AdditionalProperties to false on s when it is unset, then recurses into every property, array item, composition branch (allOf / anyOf / oneOf), and definition so the same invariant holds for the whole tree — regardless of whether intermediate nodes were already constrained.
type Extend ¶
Extend is a Transformer that merges a parent schema into the child schema when the child carries an x-extend extension. The child's own values take precedence over the parent's for all merged fields.
type ExtendSettings ¶
type ExtendSettings struct {
Schema *string `json:"schema,omitempty"`
}
ExtendSettings holds the parsed contents of an x-extend extension block. Schema names the parent schema document to inherit from (reserved for future multi-parent support; currently the parent is passed directly to Extend).