apache / camel-k

Apache Camel K is a lightweight integration platform, born on Kubernetes, with serverless superpowers
https://camel.apache.org/camel-k
Apache License 2.0
870 stars 349 forks source link

`out` attribute in Kamelet type CRD is in documentation example but not in yaml schema #2818

Open apupier opened 2 years ago

apupier commented 2 years ago

from https://camel.apache.org/camel-k/1.7.x/kamelets/kamelets-dev.html#_creating_a_simple_kamelet

apiVersion: camel.apache.org/v1alpha1
kind: Kamelet
metadata:
  name: twitter-search-source
  labels:
    camel.apache.org/kamelet.type: "source"
spec:
  definition:
    title: "Timer"
    description: "Produces periodic events with a custom payload"
    required:
      - message
    properties:
      period:
        title: Period
        description: The time interval between two events
        type: integer
        default: 1000
      message:
        title: Message
        description: The message to generate
        type: string
  types:
    out:
      mediaType: text/plain
  flow:
    from:
      uri: timer:tick
      parameters:
        period: "{{period}}"
      steps:
        - set-body:
            constant: "{{message}}"
        - to: "kamelet:sink"

in spec -> types, there is an out tag but there is no out tag defined in crd yaml schema

https://github.com/apache/camel-k/blob/48422c08bc20295d09cb31694adc177726806d6b/helm/camel-k/crds/crd-kamelet.yaml#L271-L426

apupier commented 2 years ago

is it normal? like we can have whatever attributes at this level?

astefanutti commented 2 years ago

It's "normal" because the types field has been modelled as a map, but it should probably be modelled as a comprehensive struct.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale due to 90 days of inactivity. It will be closed if no further activity occurs within 15 days. If you think that’s incorrect or the issue should never stale, please simply write any comment. Thanks for your contributions!

apupier commented 2 years ago

I think it is still a feature that can help users a lot. So putting comment to remove stale status

haanhvu commented 2 years ago

I'm working on this. Sending a PR soon.