Theme
Python packageSupported stable generatorAvailable now

Infer a normalized generation model from OpenAPI and apply bundled or project-owned Jinja template packs.

python -m pip install codepotg
On this page

Entity, relation, access, and runtime variables

Entity collections

Entity values

Entity fields

explicit records whether behavior was authored or supplied by normalization defaults.

Relations

Use resolved target for imports and generation. Preserve the original relation reference where diagnostics or compatibility require it.

Constraints

Rule expressions preserve:

  • operation;
  • field;
  • value;
  • arguments;
  • condition;
  • result branches;
  • original operation name;
  • raw arguments.

Access collections

Each policy exposes:

An operation access use exposes:

Runtime values

Transport

Hooks

Each hook use exposes the original ref, resolved hook, lifecycle phase, and stable order.

Cache effects

Cache read and invalidation values are documented with operation variables, but entity or access templates may consume resolved resource targets and tags through providers.

UI and behavior flags

Resources and operations share:

Authored and inferred states remain distinguishable.

Example entity template

A real persistence pack should also consume relation, constraint, generated strategy, and lifecycle metadata.

Guidance

  • Use normalized behavior flags instead of deriving them from field names.
  • Keep public and backend fields separate.
  • Resolve relation targets before rendering imports.
  • Preserve delete/update behavior explicitly.
  • Generate access implementations from policy meaning, not raw framework annotations.
  • Treat unresolved refs as diagnostics, not empty values.