camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lb <lburgazz...@gmail.com>
Subject Re: yaml dataformat
Date Thu, 03 Mar 2016 15:43:49 GMT
Hi,

I've finally managed to solve this issue by including yaml-snakeyaml
in org.apache.camel.maven.packaging.PackageDataFormatMojo's special
data formats handling:


private static String asModelName(String name) {
    // special for some data formats
    if ("json-gson".equals(name) || "json-jackson".equals(name) ||
"json-xstream".equals(name)) {
        return "json";
    } else if ("bindy-csv".equals(name) || "bindy-fixed".equals(name)
|| "bindy-kvp".equals(name)) {
        return "bindy";
    } else if ("zipfile".equals(name)) {
        // darn should have been lower case
        return "zipFile";
    } else if ("yaml-snakeyaml".equals(name)) {
        return "yaml";
    }
    return name;
}




On Wed, Mar 2, 2016 at 5:24 PM, lb <lburgazzoli@gmail.com> wrote:
> Hi,
>
> I'm writing a yaml dataformat which is implemented like the json
> dataformat so with the possibility to choose the library to use (even
> as today there is only one implementation) and I've an issue as my
> component fails to install because of the following error:
>
> Error loading dataformat model from camel-core. Reason:
> java.io.FileNotFoundException:
> /opt/maven-repo/org/apache/camel/camel-core/2.17-SNAPSHOT/camel-core-2.17-SNAPSHOT.jar/org/apache/camel/model/dataformat/yaml-snakeyaml.json
> (Not a directory)
>
>
> If I change the service defintion name in META-INF from yaml-snakeyaml
> to yaml it works however for json like data-formats, the service name
> is - as example - json-gson.
>
> You can find my code here:
> https://github.com/lburgazzoli/apache-camel/commit/b3d1e1b81fc599cf536091d9108974f229b4fd61
>
>
> Am I missing something ?
>
>
> Best regards,
> Luca

Mime
View raw message