-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaProps does not retain extensions #3182
Comments
Original issue: apache/camel-kamelets#284 |
That's a generated class, is your field be available in the additionalProperties? |
I've tried with this: ///usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS org.slf4j:slf4j-simple:1.7.30
//DEPS io.fabric8:kubernetes-client:5.4.1
//DEPS io.fabric8:camel-k-model-v1alpha1:5.4.1
import java.io.ByteArrayInputStream;
import java.nio.charset.StandardCharsets;
import io.fabric8.camelk.v1alpha1.Kamelet;
import io.fabric8.kubernetes.client.utils.Serialization;
class kl {
public static String KAMELET = ""
+ "apiVersion: camel.apache.org/v1alpha1\n"
+ "kind: Kamelet\n"
+ "metadata:\n"
+ " name: aws-s3-sink\n"
+ "spec:\n"
+ " definition:\n"
+ " type: object\n"
+ " properties:\n"
+ " accessKey:\n"
+ " type: string\n"
+ " format: password\n"
+ " x-descriptors:\n"
+ " - urn:alm:descriptor:com.tectonic.ui:password\n";
public static void main(String... args) throws Exception {
try (var is = new ByteArrayInputStream(KAMELET.getBytes(StandardCharsets.UTF_8))) {
var result = Serialization.unmarshal(is, Kamelet.class);
System.out.println("> " + result);
}
}
} And what I get is an exception caused by:
|
I'm not able to find |
It is a our own JSON Schema extension, is not part of k8s but should be put in additionalProperties I guess as there is a https://github.com/apache/camel-k/blob/main/config/crd/bases/camel.apache.org_kamelets.yaml#L82 (not sure if that is on the right position but does not fails in camel-k) |
We can probably configure jackson to be more relax. I think that in this case the |
that would be perfectly fine with me |
This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions! |
…Exception (fabric8io#3852) Kamelet resource seems to be using JSONSchemaProps. However, this JSONSchemaProps is not coming from Apiextensions. Camel repository seems to have it's own version of JSONSchemaProps. It contains some additional fields like `x-descriptors`. We've currently added a manual type mapping of JSONSchemaProps to `io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaProps` This works for most cases but doesn't work when some camel specific fields are used in Kamelet (like in case of fabric8io#3852, fabric8io#3182). Use CamelK's JSONSchemaProps instead of Apiextensions JSONSchemaProps. Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…Exception (fabric8io#3852) Kamelet resource seems to be using JSONSchemaProps. However, this JSONSchemaProps is not coming from Apiextensions. Camel repository seems to have it's own version of JSONSchemaProps. It contains some additional fields like `x-descriptors`. We've currently added a manual type mapping of JSONSchemaProps to `io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaProps` This works for most cases but doesn't work when some camel specific fields are used in Kamelet (like in case of fabric8io#3852, fabric8io#3182). Use CamelK's JSONSchemaProps instead of Apiextensions JSONSchemaProps. Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…Exception (#3852) Kamelet resource seems to be using JSONSchemaProps. However, this JSONSchemaProps is not coming from Apiextensions. Camel repository seems to have it's own version of JSONSchemaProps. It contains some additional fields like `x-descriptors`. We've currently added a manual type mapping of JSONSchemaProps to `io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaProps` This works for most cases but doesn't work when some camel specific fields are used in Kamelet (like in case of #3852, #3182). Use CamelK's JSONSchemaProps instead of Apiextensions JSONSchemaProps. Signed-off-by: Rohan Kumar <rohaan@redhat.com>
i.e. there's no way to get the value of
x-descriptors
Looking at the
JSONSchemaProps
class, it looks like it handle a specific set of json extensions.Would be nice to have a generic support for extensions.
The text was updated successfully, but these errors were encountered: