source/json_schema.cpp file

Implementation of the JSON Schema dump for the Planning model.

The schema is generated from the daw_json_link json_data_contract mappings by a small bespoke emitter (SchemaBuilder below) instead of daw::json::to_json_schema<T>.

Why not daw::json::to_json_schema

The element-level field schedules (OptTBRealFieldSched, ...) map to json_variant_type_lists whose alternatives include bare scalar types (double, int, std::string). daw's variant handler reads JsonElement::expected_type on every alternative, which bare scalars do not have, so to_json_schema<Planning> fails to compile. daw also inlines every nested class, which would repeat the element definitions many times over.

The bespoke emitter walks the same compile-time member lists, deduces each variant alternative through json_link_no_name (so bare scalars work), and emits one $defs entry per contract type with $ref links between them. Every type reachable from Planning is covered, so the dump is the complete input scheme and the single source the Python tooling (igtopt template generator, contract snapshot) derives its field lists from.

Namespaces

namespace gtopt