pub struct ResolveOptions {
pub direction: Direction,
pub operation: String,
pub strict: bool,
pub include_future: bool,
pub def_name: Option<String>,
}Expand description
Options for schema resolution.
Fields§
§direction: DirectionWhether resolving for request or response.
operation: StringThe operation to resolve for (e.g., “create”, “update”). Will be normalized to lowercase.
strict: boolWhen true, sets additionalProperties: false on all object schemas
to reject unknown fields. Defaults to false to respect schema extensibility.
include_future: boolWhen true, includes fields with omit visibility that have a transition
targeting a non-omit value (i.e., planned additions). These fields appear
in the resolved output with x-ucp-schema-transition metadata but are NOT
added to required. Completes the lifecycle symmetry: deprecations (to=omit)
are always surfaced; this flag surfaces planned additions (from=omit) too.
def_name: Option<String>Explicit $defs entry to select as the validation/output target,
overriding the {op}_{direction} derivation used for container
capabilities. Names non-derivable shapes that aren’t an operation +
direction — transport message types (error_response), host views
(business_schema), and sub-types of single-object schemas
(cart → checkout). When set, selection ignores the container check
so it works on schemas that also have a root body.
Implementations§
Source§impl ResolveOptions
impl ResolveOptions
Sourcepub fn new(direction: Direction, operation: impl Into<String>) -> Self
pub fn new(direction: Direction, operation: impl Into<String>) -> Self
Create new resolve options with strict mode disabled (default).
Operation is normalized to lowercase for case-insensitive matching. Strict mode is off by default to respect UCP’s extensibility model: schemas validate known fields but allow additional properties.
Sourcepub fn strict(self, strict: bool) -> Self
pub fn strict(self, strict: bool) -> Self
Set strict mode (additionalProperties: false on all objects).
Sourcepub fn include_future(self, include_future: bool) -> Self
pub fn include_future(self, include_future: bool) -> Self
Include future fields (omit-visibility with non-omit transition target).
Sourcepub fn def_name(self, def_name: Option<String>) -> Self
pub fn def_name(self, def_name: Option<String>) -> Self
Select an explicit $defs entry, overriding {op}_{direction}
derivation (see Self::def_name).
Trait Implementations§
Source§impl Clone for ResolveOptions
impl Clone for ResolveOptions
Source§fn clone(&self) -> ResolveOptions
fn clone(&self) -> ResolveOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more