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

kamelet: allow to add additional attributes to in/out #3090

Closed
lburgazzoli opened this issue Mar 8, 2022 · 4 comments
Closed

kamelet: allow to add additional attributes to in/out #3090

lburgazzoli opened this issue Mar 8, 2022 · 4 comments

Comments

@lburgazzoli
Copy link
Contributor

As today, a kamelet has the option to define the types it supports but that is limited to the following information:

type EventTypeSpec struct {
	// media type as expected for HTTP media types (ie, application/json)
	MediaType string `json:"mediaType,omitempty"`
	// the expected schema for the event
	Schema *JSONSchemaProps `json:"schema,omitempty"`
}

Given that a kamelet may be more complex and the tooling using them may need more information it would be nice to have the option to add additional metadata, as example, in some case it may be useful to add an information about what is the Java class the output of a camel is build upon:

spec:
  out:
    mediaType: "accplication/json"
    annotations:
        contentClass: com.acme.Foo

This may be useful for tools as they may compute the scheme of the payload.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 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!

@squakez
Copy link
Contributor

squakez commented Apr 18, 2024

Given #4100 - is this still relevant @christophd ?

@christophd
Copy link
Contributor

I think partially this has been done already with #4100

The Java contentClass class information that is explicitly mentioned in this issue is missing though in the DataTypes section in Kamelet spec AFAIK.

Information such as the Java contentClass may be given on the individual schema resolver step using the resolve-pojo-schema-action Kamelet. The idea is to resolve the schema for a contentClass (delegating to Avro, Protobuf, ...) in a first step and the have the information available to serialize/deserialize the content using one of the serdes action Kamelets (e.g. avro-deserialize-action

@lburgazzoli WDYT?

@lburgazzoli
Copy link
Contributor Author

lburgazzoli commented Apr 19, 2024

If I properly recall the problem, here the idea was more related to design time, so to provide hints for tooling i.e. if you have a data mapper then you can use the schema in the mapper. But I think we can close this issue and eventually open a new and more detailed one.

@squakez squakez closed this as not planned Won't fix, can't repro, duplicate, stale Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants