@@ -268,20 +268,19 @@ AllDtos Registry (``registry.hpp``)
268268
269269 The free function ``collect_component_schemas() `` iterates ``AllDtos `` at
270270compile time (via ``std::index_sequence ``) and calls
271- ``SchemaWriter<T>::schema() `` for each type, producing the bulk of the
272- ``components/schemas `` map. ``SchemaBuilder::component_schemas() `` (in
273- ``src/openapi/schema_builder.cpp ``) merges these DTO-generated entries with a
274- small number of explicitly hand-written survivors:
275-
276- - **``from_ros_msg`` / ``from_ros_srv_request`` / ``from_ros_srv_response`` ** -
277- schema factories for dynamic ROS 2 payloads whose field names are not known
278- at compile time (topic samples, service request/response bodies).
279- - **``binary_schema`` ** and **``generic_object_schema`` ** - trivial inline
280- schema objects used for bulk-data and free-form fields.
281-
282- With the exception of these survivors, every schema in ``components/schemas ``
283- is generated from ``AllDtos ``. No runtime loop over a dynamic registry is
284- required.
271+ ``SchemaWriter<T>::schema() `` for each type. ``SchemaBuilder::component_schemas() ``
272+ (in ``src/openapi/schema_builder.cpp ``) returns exactly this map: every entry in
273+ ``components/schemas `` is generated from ``AllDtos ``, with no hand-written
274+ survivors merged in. No runtime loop over a dynamic registry is required.
275+
276+ The hand-written schema factories that remain on ``SchemaBuilder `` -
277+ ``from_ros_msg `` / ``from_ros_srv_request `` / ``from_ros_srv_response `` (for
278+ dynamic ROS 2 payloads whose field names are not known at compile time) and
279+ ``binary_schema `` / ``generic_object_schema `` - are no longer part of the
280+ ``components/schemas `` map. They are called by the path builder
281+ (``src/openapi/path_builder.cpp ``) to emit *inline * operation schemas for the
282+ per-topic / per-service / per-action routes, whose request and response shape is
283+ derived from the live ROS 2 type rather than from a named DTO.
285284
286285The ``Collection<T> `` template is a generic DTO for paginated list responses
287286(``{"items": [...]} ``). It is specialized for each element type in
@@ -539,23 +538,25 @@ OpenAPI Generation Pipeline
539538
540539The published ``openapi.json `` is assembled mechanically from two sources:
541540
542- - ``components/schemas `` is the union of
543- ``collect_component_schemas<AllDtos>() `` (one entry per DTO listed in
544- ``dto/registry.hpp ``) and a small set of explicit survivors in
545- ``SchemaBuilder::component_schemas() `` for genuinely dynamic ROS payloads
546- (``from_ros_msg `` / ``from_ros_srv_request `` / ``from_ros_srv_response ``,
547- ``binary_schema ``, ``generic_object_schema ``).
541+ - ``components/schemas `` is exactly ``collect_component_schemas<AllDtos>() `` -
542+ one entry per DTO listed in ``dto/registry.hpp ``, with no hand-written
543+ survivors merged in.
548544- ``paths `` is ``RouteRegistry::to_openapi_paths() ``: every typed route
549545 contributes a path item with ``$ref `` entries auto-derived from its
550546 ``TResponse `` / ``TBody `` template parameters plus any tags, summary,
551547 description, ``operation_id ``, parameter, or extra-status metadata pinned
552- on the route via the fluent ``RouteEntry `` builder.
548+ on the route via the fluent ``RouteEntry `` builder. The per-topic /
549+ per-service / per-action routes for genuinely dynamic ROS 2 payloads carry an
550+ *inline * schema built by ``SchemaBuilder ``'s ``from_ros_msg `` /
551+ ``from_ros_srv_request `` / ``from_ros_srv_response `` / ``binary_schema `` /
552+ ``generic_object_schema `` factories (these feed path operations, not
553+ ``components/schemas ``).
553554
554555``OpenApiSpecBuilder::build() `` then assembles ``info `` / ``servers `` /
555556``tags `` / ``security `` around those two compiled blocks. There are no
556- hand-written ``paths `` items in the published spec, and no hand-written
557- schema blocks beyond the survivors above . Adding a route or a DTO field
558- updates the spec on the next process start with no schema-side edit.
557+ hand-written ``paths `` items in the published spec, and no hand-written schema
558+ blocks in `` components/schemas `` . Adding a route or a DTO field updates the
559+ spec on the next process start with no schema-side edit.
559560
560561Optional fields are now emitted as ``anyOf: [<inner>, {type: "null"}] ``
561562(OpenAPI 3.1 idiom) so generated clients see ``T | null `` rather than
0 commit comments