[
https://issues.apache.org/jira/browse/CAMEL-20640?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17834243#comment-17834243
]
Claus Ibsen commented on CAMEL-20640:
-------------------------------------
Sample yaml routes
{code}
- restConfiguration:
apiContextPath: api-doc
bindingMode: json
- rest:
id: rest-ff6d
path: abc
consumes: application/json
produces: application/json
get:
- id: get-aec7
path: "{id}"
to: direct:dummy
- route:
id: dummy
from:
id: from-64ca
uri: direct
parameters:
name: dummy
steps:
- log:
id: log-1875
message: ${body}
{code}
Gives rest api without consumes/produces
{code}
{
openapi: "3.0.0",
info: { },
servers: [
{
url: "http://0.0.0.0"
}
],
tags: [
{
name: "abc"
}
],
paths: {
/abc/{id}: {
get: {
tags: [
"abc"
],
operationId: "get-aec7",
parameters: [
{
name: "id",
in: "path",
required: true,
schema: {
type: "string"
}
}
],
responses: {
default: { }
}
}
}
}
}
{code}
> rest-dsl - Using code first and setting consumes/produces on rest
> configuration should be used for api-doc
> ----------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-20640
> URL: https://issues.apache.org/jira/browse/CAMEL-20640
> Project: Camel
> Issue Type: Bug
> Components: rest
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 4.6.0
>
>
> When using rest-dsl code-first and have api-doc exposed then the generate doc
> does not include produces/consumes on the API operations if its configured
> globally in the rest configuration.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)