KaotoIO/kaoto-backend

[BUG] An empty route is generating a null step

lordrip opened this issue · 1 comments

Describe the bug
When adding an empty route through the YAML source file, it generates an array with a null step.

To Reproduce
Steps to reproduce the behavior:
the steps are:

  1. Using the source code editor, fill this YAML and sync it
YAML
apiVersion: camel.apache.org/v1
kind: Integration
metadata:
  name: Integration-1
spec:
  flows:
  - route:
      id: route-1234
      from:
        uri: cron:cron
        parameters:
          schedule: '1000'
        steps:
        - set-body:
            simple: body
        - to:
            uri: log:log1
  - route:
      id: route-4321
      from:
        uri: timer:test
        steps:
        - to:
            uri: log:log2
  1. Append the following empty route at the end of the file:
YAML
  - route:
      from:
        uri: null
        steps: []
  1. sync again and notice the browser console.

Expected behavior
It should return a single Integration CRD with 3 flows in it, with the third one being completely empty.

Logs

TypeError: can't access property "name", step is null

the Camel Route DSL works fine, it seems to be only happening for the Integrarion DSL