Expand description
Shared CloudFormation resource-provider schema model and the raw-JSON → compiled-schema transform.
This is the single source of truth for turning a raw CloudFormation registry
schema ($ref, type, enum, /properties/... paths, allOf+if, …) into
the compiled representation that the schema validator consumes.
- At build time,
codegen_schema_validatorcompiles every bundled schema withcompile_schemaand serializes the results tocompiled_schemas.json(embedded into the binary).BTreeMapfields make that output deterministic. - At run time, the
schema-validatorcrate applies additional/overlay schemas by callingcompile_schemaand converting the result into its own runtime schema type. Routing overlays through this exact function guarantees the transform is the same one bundled schemas go through.
The transform is shared; the input is not. Bundled schemas are compiled
from the build pipeline’s patched archive, which adds keywords the raw registry
does not carry (case-insensitive enums, requiredOr/requiredXor,
dependentExcluded, injected conditional allOf fragments). A caller-supplied
overlay is compiled straight from the JSON it provides, so anything the
pipeline would have contributed is absent unless the caller states it
explicitly. Callers must not assume an overlay for a bundled type reproduces
that type’s enriched schema.
This module is intentionally dependency-free (only serde/serde_json +
std) and is not behind the maintenance feature, so the runtime can use the
transform without pulling in the build pipeline’s heavy dependencies.
Modules§
- keywords
- Named constants for every raw JSON-schema and CloudFormation provider-schema
keyword the compiler reads, grouped by how the compiled model represents
them. This module is the single source of truth for the vocabulary shared
between the build-time compilation pipeline and the runtime overlay
preflight in
schema-validator.
Structs§
Enums§
- Prop
Type - RefSiblings
- How to treat constraint keywords written beside a
$ref.
Functions§
- compile_
schema - Compiles a raw provider schema with
RefSiblings::Enforce- the overlay path. The build pipeline usescompile_schema_withandRefSiblings::Ignoreinstead; seeRefSiblings. - compile_
schema_ with - Compiles a raw CloudFormation resource provider schema into the compiled representation.
- unsupported_
root_ conditionals - Describes every resource-root conditional whose
ifschema the compiler cannot represent faithfully: a keyword outsidekeywords::COMPILE_CONDITION_SCHEMA_FIELDS, or anifthat states no condition at all. Such a condition would compile to one that always (or never) matches, silently changing what thethenbranch applies to, so the build pipeline refuses to emit it. Sub-conditions underanyOf,oneOfandnotfollow the same grammar and are audited recursively.
Type Aliases§
- SubSchema
- A composition branch is now a full property schema - every constraint that
compile_propproduces is available in a branch and evaluated by the runtime. This alias maintains naming clarity at usage sites.