Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
apupier opened this issue Dec 7, 2021 · 5 comments
Labels
kind/feature New feature or request

Comments

@apupier
Copy link
Contributor

apupier commented Dec 7, 2021

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

types:
additionalProperties:
properties:
mediaType:
type: string
schema:
description: JSONSchemaProps is a JSON-Schema following Specification
Draft 4 (http://json-schema.org/).
properties:
$schema:
description: JSONSchemaURL represents a schema url.
type: string
description:
type: string
example:
description: 'JSON represents any valid JSON value. These
types are supported: bool, int64, float64, string, []interface{},
map[string]interface{} and nil.'
x-kubernetes-preserve-unknown-fields: true
externalDocs:
description: ExternalDocumentation allows referencing an
external resource for extended documentation.
properties:
description:
type: string
url:
type: string
type: object
id:
type: string
properties:
additionalProperties:
properties:
default:
description: default is a default value for undefined
object fields.
x-kubernetes-preserve-unknown-fields: true
description:
type: string
enum:
items:
description: 'JSON represents any valid JSON value.
These types are supported: bool, int64, float64,
string, []interface{}, map[string]interface{}
and nil.'
x-kubernetes-preserve-unknown-fields: true
type: array
example:
description: 'JSON represents any valid JSON value.
These types are supported: bool, int64, float64,
string, []interface{}, map[string]interface{} and
nil.'
x-kubernetes-preserve-unknown-fields: true
exclusiveMaximum:
type: boolean
exclusiveMinimum:
type: boolean
format:
description: "format is an OpenAPI v3 format string.
Unknown formats are ignored. The following formats
are validated: \n - bsonobjectid: a bson object
ID, i.e. a 24 characters hex string - uri: an URI
as parsed by Golang net/url.ParseRequestURI - email:
an email address as parsed by Golang net/mail.ParseAddress
- hostname: a valid representation for an Internet
host name, as defined by RFC 1034, section 3.1 [RFC1034].
- ipv4: an IPv4 IP as parsed by Golang net.ParseIP
- ipv6: an IPv6 IP as parsed by Golang net.ParseIP
- cidr: a CIDR as parsed by Golang net.ParseCIDR
- mac: a MAC address as parsed by Golang net.ParseMAC
- uuid: an UUID that allows uppercase defined by
the regex (?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{12}$
- uuid3: an UUID3 that allows uppercase defined
by the regex (?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?3[0-9a-f]{3}-?[0-9a-f]{4}-?[0-9a-f]{12}$
- uuid4: an UUID4 that allows uppercase defined
by the regex (?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?4[0-9a-f]{3}-?[89ab][0-9a-f]{3}-?[0-9a-f]{12}$
- uuid5: an UUID5 that allows uppercase defined
by the regex (?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?5[0-9a-f]{3}-?[89ab][0-9a-f]{3}-?[0-9a-f]{12}$
- isbn: an ISBN10 or ISBN13 number string like \"0321751043\"
or \"978-0321751041\" - isbn10: an ISBN10 number
string like \"0321751043\" - isbn13: an ISBN13 number
string like \"978-0321751041\" - creditcard: a credit
card number defined by the regex ^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\\\\d{3})\\\\d{11})$
with any non digit characters mixed in - ssn: a
U.S. social security number following the regex
^\\\\d{3}[- ]?\\\\d{2}[- ]?\\\\d{4}$ - hexcolor:
an hexadecimal color code like \"#FFFFFF: following
the regex ^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$ -
rgbcolor: an RGB color code like rgb like \"rgb(255,255,2559\"
- byte: base64 encoded binary data - password: any
kind of string - date: a date string like \"2006-01-02\"
as defined by full-date in RFC3339 - duration: a
duration string like \"22 ns\" as parsed by Golang
time.ParseDuration or compatible with Scala duration
format - datetime: a date time string like \"2014-12-15T19:30:20.000Z\"
as defined by date-time in RFC3339."
type: string
id:
type: string
maxItems:
format: int64
type: integer
maxLength:
format: int64
type: integer
maxProperties:
format: int64
type: integer
maximum:
description: A Number represents a JSON number literal.
type: string
minItems:
format: int64
type: integer
minLength:
format: int64
type: integer
minProperties:
format: int64
type: integer
minimum:
description: A Number represents a JSON number literal.
type: string
multipleOf:
description: A Number represents a JSON number literal.
type: string
nullable:
type: boolean
pattern:
type: string
title:
type: string
type:
type: string
uniqueItems:
type: boolean
x-descriptors:
description: The list of descriptors that determine
which UI components to use on different views
items:
type: string
type: array
type: object
type: object
required:
items:
type: string
type: array
title:
type: string
type:
type: string
type: object
type: object
type: object
type: object

@apupier
Copy link
Contributor Author

apupier commented Dec 7, 2021

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

@astefanutti
Copy link
Member

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
Copy link
Contributor

github-actions bot commented Mar 8, 2022

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
Copy link
Contributor Author

apupier commented Mar 8, 2022

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

@squakez squakez added kind/feature New feature or request status/never-stale and removed status/stale labels Mar 8, 2022
@haanhvu
Copy link
Contributor

haanhvu commented Apr 17, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants