Infer a normalized generation model from OpenAPI and apply bundled or project-owned Jinja template packs.
python -m pip install codepotgOn this page
Schema and field variables
Schema collections
Schema values
Each schema exposes:
Identity and role
idis the normalized registry identity.nameis the full naming object.refpreserves the original reference where applicable.kindclassifies model, DTO, enum, primitive, alias, composed, or unknown shapes.rolerecords create, update, query, params, body, response, or another Codepot role.resourcelinks the schema to its owning resource when known.
Constraints
default and const are presence-aware, so explicit null remains different from an absent value.
Composition
Each branch uses the normal schema-use shape and can be a ref or inline schema.
Array information
The source may also preserve advanced JSON Schema keywords under normalized constraints or raw.
Object information
additional_properties distinguishes allowed, forbidden, typed, and referenced forms.
Fields
Schema and entity fields share this core:
Schema fields additionally expose:
- reference identity and resolved target;
- item schemas for arrays;
- inline and referenced composition;
- inherited/projected origin;
- target-language type helpers.
Query capabilities
Search values:
Enum values
An enum schema exposes enum_type and ordered enum_values. Templates should preserve source values and use language helpers for identifiers or literals.
Dependencies
schema.dependencies records referenced schemas and related generation facts. Prefer planned dependencies and file imports over recursively scanning field refs in the template.
Example
Guidance
- Prefer
schema.kindandschema.roleover naming conventions. - Use presence-aware values when rendering defaults.
- Preserve enum source values separately from target identifiers.
- Check nullable and required independently.
- Use normalized composition before
schema.raw.