ores.http.synthetic
Table of Contents
2. Summary
ores.http.synthetic is the adapter part that projects the synthetic domain
onto the HTTP server's REST surface. It holds the generated route units for
the synthetic models that opt in, and each unit owns one route per derived
verb.
Synthetic's models opt in through the :ores.cpp.http-route.enabled: property
in their own model drawer, so a model that needs no route can leave the facet
off. The units speak the canonical protocol over NATS and hold no service,
repository or database context: the synthetic service stays the only place
that decides, and the caller's own token travels with every forwarded request.
The part declares #+component_kind: adapter. Its CMakeLists.txt files are
hand-authored, because the link libraries belong to the HTTP surface rather
than to the domain, and codegen writes only the two component_files.cmake
lists. A regeneration therefore never writes over the build.
The units are output of the ores.cpp.http-route facet, which is opt-in per
model. The facet writes here because the part is named after the domain the
units project, which is the fractal naming rule in
Component architecture.
The units answer under the simulation area, which
#+http_area: states on each model rather than the part stating it once,
because the area is a published namespace and not a property of the component
that happens to hold the model.
3. Inputs
- HTTP requests on the
/api/v1/simulation/...paths the units register. - The caller's bearer token, forwarded to the service on every NATS request.
- The connected NATS client the hand-written per-component aggregator passes
to
register_routes. - The synthetic models under
projects/ores.synthetic/modeling/whose drawers opt in to theores.cpp.http-routefacet.
4. Outputs
- One route unit per opted-in model, at
src/routes/synthetic/<unit>_routes.cppandinclude/ores.http/routes/synthetic/<unit>_routes.hpp. - The routes and their OpenAPI schemas, registered on the router and the endpoint registry.
- NATS request messages to the synthetic service, one per route.
5. Entry points
include/ores.http/routes/synthetic/– the generated unit headers.src/routes/synthetic/– the generated unit implementations.yield_curve_process_type_routes– the unit-level entry the host calls to install the process types' routes.
6. Dependencies
ores.http.api– the router, the route builder, the OpenAPI registry and the request/response types.ores.nats– NATS transport for service calls.ores.synthetic.api– the canonical protocol messages the units send.ores.utility– the codecs and the wire support types.ores.logging– logger factory.
7. See also
- ores.http.server – the process that hosts these routes.
- ores.cpp.http-route – the facet that emits the units.
- Component architecture – the composite and adapter kinds.
- ores.synthetic – the domain this part projects.
target_link_libraries(${lib_target_name}
PUBLIC
ores.http.api.lib
ores.nats.lib
ores.logging.lib
PRIVATE
ores.synthetic.api.lib
ores.utility.lib)
target_link_libraries(${tests_target_name}
PRIVATE
${lib_target_name}
ores.testing.lib
Catch2::Catch2
ores.openssl_cleanup
Threads::Threads)
