jboss-fuse / fuse-apicurito-generator

Fuse Apicurito Generator
5 stars 14 forks source link

invalid camel context generated with multiple xml headers #2

Closed bfitzpat closed 6 years ago

bfitzpat commented 6 years ago

I am attaching an apicurito-generated swagger file that I then exported to a camel project using the fuse apicurito generator. It seems that the cleanup pass here (https://github.com/jboss-fuse/fuse-apicurito-generator/blob/master/src/main/java/com/redhat/fuse/apicurio/jaxrs/GenerateFuseProjectResource.java#L154) may only work for the very first instance of the XML header info in the generated rest dsl, so we end up with a funky part...

(about line 34)

        <rest path="" bindingMode="json" enableCORS="true">
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <rests xmlns="http://camel.apache.org/schema/spring">
        <rest>
            <get id="getGreeting" uri="/hello">
                <description>Returns a greeting back to the caller.</description>

Not sure the best way to handle the weirdness, whether brute force Java hacking is the way we should go here or if we need something else?

camel-project.zip

openapi-spec(3).zip

bfitzpat commented 6 years ago

Fixed issue (was problem with regex search/replace for some reason) and added a JUnit test.

https://github.com/jboss-fuse/fuse-apicurito-generator/pull/5

bfitzpat commented 6 years ago

Fixed with https://github.com/jboss-fuse/fuse-apicurito-generator/pull/5