Skip to content

generate-schema Camel CLI command #18410

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

Croway
Copy link
Contributor

@Croway Croway commented Jun 19, 2025

Example usage:

$ camel generate-schema milvus io.milvus.param.dml.InsertParam

Schema saved to: ./io.milvus.param.dml.InsertParam-schema.json

The resulting schema can be used to marshal/unmarshal Java objects instead of a custom Camel processor. This is an enabler for low-code scenarios.

@davsclaus
Copy link
Contributor

can you move this into camel-jbang-plugin-generate

@davsclaus
Copy link
Contributor

then you can use camel generate schema .... as the command. And its installed together with the other generate commands and its seperated from the core jbang

@Croway
Copy link
Contributor Author

Croway commented Jun 19, 2025

then you can use camel generate schema .... as the command. And its installed together with the other generate commands and its seperated from the core jbang

How can I test the generate plugin? I am getting this error

Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact com.foo:camel-jbang-plugin-generate:jar:1.0-SNAPSHOT in ....
	at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:42) ~[maven-resolver-connector-basic-1.9.23.jar:1.9.23]
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:417) ~[maven-resolver-connector-basic-1.9.23.jar:1.9.23]
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:260) ~[maven-resolver-connector-basic-1.9.23.jar:1.9.23]
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:537) ~[maven-resolver-impl-1.9.23.jar:1.9.23]
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:449) ~[maven-resolver-impl-1.9.23.jar:1.9.23]
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:261) ~[maven-resolver-impl-1.9.23.jar:1.9.23]
	at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:353) ~[maven-resolver-impl-1.9.23.jar:1.9.23]
	at org.apache.camel.tooling.maven.MavenDownloaderImpl.resolveArtifacts(MavenDownloaderImpl.java:470) ~[camel-tooling-maven-4.13.0-SNAPSHOT.jar:4.13.0-SNAPSHOT]
	at org.apache.camel.main.download.MavenDependencyDownloader.resolveDependenciesViaAether(MavenDependencyDownloader.java:588) ~[camel-kamelet-main-4.13.0-SNAPSHOT.jar:4.13.0-SNAPSHOT]
	at org.apache.camel.main.download.MavenDependencyDownloader.lambda$doDownloadDependencyWithParent$0(MavenDependencyDownloader.java:294) ~[camel-kamelet-main-4.13.0-SNAPSHOT.jar:4.13.0-SNAPSHOT]
	```
	
	`com.foo:camel-jbang-plugin-generate:jar:1.0-SNAPSHOT` this seems strange

@davsclaus
Copy link
Contributor

I assume you can add tests in src/main/test folder in the generate module (see how camel-kubernetes-plugin has a bunch of tests)

@Croway
Copy link
Contributor Author

Croway commented Jun 19, 2025

@davsclaus fyi, I managed to test it locally via camel plugin add generate --gav org.apache.camel:camel-jbang-plugin-generate:4.13.0-SNAPSHOT and the command camel generate schema milvus io.milvus.param.dml.InsertParam is executed successfully

Copy link
Contributor

@oscerd oscerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor finding.

@Croway Croway force-pushed the generate-schema branch from dfeac11 to 5c966f5 Compare June 19, 2025 16:19
@Croway Croway force-pushed the generate-schema branch from ac2b8d9 to 9dcdd6e Compare June 23, 2025 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants