You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2021/12/09 15:16:00 UTC
[jira] [Comment Edited] (CAMEL-17304) camel-yaml-dsl: consistency of from
[ https://issues.apache.org/jira/browse/CAMEL-17304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17456494#comment-17456494 ]
Claus Ibsen edited comment on CAMEL-17304 at 12/9/21, 3:15 PM:
---------------------------------------------------------------
The schema is now:
{code}
"org.apache.camel.model.RouteDefinition" : {
"type" : "object",
"properties" : {
"from" : {
"$ref" : "#/items/definitions/org.apache.camel.model.FromDefinition"
},
"group" : {
"type" : "string"
},
"id" : {
"type" : "string"
},
"route-configuration-id" : {
"type" : "string"
}
},
"required" : [ "from" ]
},
"org.apache.camel.model.FromDefinition" : {
"oneOf" : [ {
"type" : "string"
}, {
"type" : "object",
"properties" : {
"parameters" : {
"type" : "object"
},
"steps" : {
"type" : "array",
"items" : {
"$ref" : "#/items/definitions/org.apache.camel.model.ProcessorDefinition"
}
},
"uri" : {
"type" : "string"
}
}
} ],
"required" : [ "steps", "uri" ]
},
{code}
I wonder if that is a problem as you can see that a from has required uri and steps.
But in the inlined variant then the oneOf string is the uri, then you must add the steps as well.
was (Author: davsclaus):
The schema is now:
{code}
"org.apache.camel.model.FromDefinition" : {
"oneOf" : [ {
"type" : "string"
}, {
"type" : "object",
"properties" : {
"parameters" : {
"type" : "object"
},
"steps" : {
"type" : "array",
"items" : {
"$ref" : "#/items/definitions/org.apache.camel.model.ProcessorDefinition"
}
},
"uri" : {
"type" : "string"
}
}
} ],
"required" : [ "steps", "uri" ]
},
{code}
I wonder if that is a problem as you can see that a from has required uri and steps.
But in the inlined variant then the oneOf string is the uri, then you must add the steps as well.
> camel-yaml-dsl: consistency of from
> -----------------------------------
>
> Key: CAMEL-17304
> URL: https://issues.apache.org/jira/browse/CAMEL-17304
> Project: Camel
> Issue Type: Improvement
> Components: camel-yaml-dsl
> Reporter: Marat Gubaidullin
> Assignee: Claus Ibsen
> Priority: Major
> Fix For: 3.14.0
>
> Attachments: Screen Shot 2021-12-08 at 12.47.35 PM.png, Screen Shot 2021-12-08 at 12.48.33 PM.png
>
>
> *from* as root element and *from* in *route* are implemented different
> 1. this one in correctÂ
> {code:java}
> - from:
> uri: "timer:info"
> steps:
> - log: "message"
> {code}
> 2. This one is *not correct*
> {code:java}
> - route:
> id: demo-route
> from:
> uri: "timer:info"
> steps:
> - log: "message"
> {code}
> 3. This one is correct again
> {code:java}
> - route:
> id: demo-route
> from:
> uri: "timer:info"
> steps:
> - log: "message"
> {code}
> This is because of 2 different *from* in camel-yaml-dsl.json (see attachment)
> From user experience it would be great to have only one implementation of from.
> I would recommend to have the same as all EIP DSL definitions when *steps* is a field inside element. Like in example 1 and 2 above.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)