[
https://issues.apache.org/jira/browse/CAMEL-24125?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen updated CAMEL-24125:
--------------------------------
Component/s: camel-jbang
> camel-console - Expose dev console API contract via OpenAPI spec at /q/dev/api
> ------------------------------------------------------------------------------
>
> Key: CAMEL-24125
> URL: https://issues.apache.org/jira/browse/CAMEL-24125
> Project: Camel
> Issue Type: Improvement
> Components: camel-jbang
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Major
> Fix For: 4.22.0
>
>
> When using Camel JBang in dev mode, the dev consoles are available at /q/dev/
> endpoints. Currently, to discover the available parameters, types, enums, and
> defaults for each console, you need to look at the source code.
> Since we now support POST (JSON body) on dev console endpoints, and we
> already have rich generated metadata for every console (parameter name, type,
> enum values, default value, required flag, description), we can expose this
> as an OpenAPI specification at /q/dev/api.
> The approach:
> - Add a new /q/dev/api endpoint in ManagementHttpServer that generates an
> OpenAPI 3.0 spec
> - For each registered dev console, generate:
> - GET /q/dev/{id} with query parameters from the console metadata
> - POST /q/dev/{id} with a JSON request body schema from the same parameters
> - The index listing GET /q/dev
> - Type mapping from console metadata: string, integer, boolean, enum
> constraints
> - The spec is dynamic - reflects whichever consoles are actually loaded at
> runtime (including component-specific ones like Kafka, OpenTelemetry, etc.)
> - Console metadata is already available at runtime via
> CatalogCamelContext.getDevConsoleParameterJsonSchema()
> This would make the dev console API self-documenting and allow tools, IDEs,
> and AI agents to discover and use the API without reading source code.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)