[
https://issues.apache.org/jira/browse/CAMEL-24565?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen updated CAMEL-24565:
--------------------------------
Component/s: tooling
> camel-console: Authoritative typed response records so dev console OpenAPI
> response schemas are not empty
> ---------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-24565
> URL: https://issues.apache.org/jira/browse/CAMEL-24565
> Project: Camel
> Issue Type: New Feature
> Components: camel-core, tooling
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Major
> Fix For: 4.23.0
>
>
> Follow-up to CAMEL-24564 (https://github.com/apache/camel/pull/25885). The
> generated OpenAPI spec currently declares every dev console's 200 response as
> "content": {"application/json": {}} -- an empty schema, no contract for what
> actually comes back.
> This adds a real per-console response contract, declared statically in the
> Java source as a nested `public record Response(...)` next to doCallJson(),
> so it is visible to any future editor (human or AI) touching that method, and
> is read by the OpenAPI generator to produce a JSON Schema.
> Decision: the record must be authoritative -- doCallJson() actually
> constructs and returns it (converted to JsonObject via a new generic
> reflective mapper), not just a parallel declarative doc that could drift from
> the real output.
> New infrastructure needed (none of this exists today):
> - Runtime: org.apache.camel.util.json.JsonRecordSupport in
> tooling/camel-util-json -- generic record -> JsonObject reflective converter.
> - Build-time: a static buildResponseSchema(Class) method in
> GenerateDevConsoleMojo (tooling/maven/camel-package-maven-plugin) -- generic
> record-class -> JSON Schema reflective generator, reading @Metadata
> descriptions off record components.
> - DevConsoleModel (camel-tooling-model) gains a responseSchema field (raw
> JsonObject), read/written by JsonMapper, consumed by
> DevConsoleOpenApiHelper.buildPathItem() to populate the response content
> schema instead of the empty placeholder.
> Pilot scope (5 consoles, ordered by increasing complexity):
> CircuitBreakerDevConsole, InflightConsole, TypeConverterConsole,
> HealthDevConsole, ContextDevConsole. The remaining ~50 dev consoles keep the
> empty placeholder until a follow-up continues the rollout.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)