Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-14965

camel-restdsl-openapi-plugin not working with yaml

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 3.3.0
    • tooling
    • Unknown

    Description

      Hi,

      I am trying to generate rest DSL router and model files using yaml file with the camel-restdsl-openapi-plugin, But I am getting below error,

      Caused by: com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'openapi': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false') at [Source: (FileInputStream); line: 1, column: 9]        at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1840)        at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:722)        at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._reportInvalidToken(UTF8StreamJsonParser.java:3556)        at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._handleUnexpectedValue(UTF8StreamJsonParser.java:2651)        at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._nextTokenNotInObject(UTF8StreamJsonParser.java:856)        at com.fasterxml.jackson.core.json.UTF8StreamJsonParser.nextToken(UTF8StreamJsonParser.java:753)        at com.fasterxml.jackson.databind.ObjectMapper._readTreeAndClose(ObjectMapper.java:4231)        at com.fasterxml.jackson.databind.ObjectMapper.readTree(ObjectMapper.java:2692)        at org.apache.camel.maven.generator.openapi.AbstractGenerateMojo.readOpenApiDoc(AbstractGenerateMojo.java:277)        at org.apache.camel.maven.generator.openapi.GenerateMojo.execute(GenerateMojo.java:60)        ... 23 more

      Below is my plugin in pom

      <plugin>               

      <groupId>org.apache.camel</groupId>               

      <artifactId>camel-restdsl-openapi-plugin</artifactId>               

      <version>${camel.version}</version>               

      <configuration>                    <specificationUri>${project.basedir}/src/spec/openapi.yaml</specificationUri>                </configuration>           

      </plugin>            

       

      It seems like it is expecting json format even though I have specified yaml file.

      When I send openapi.json instead of yaml file it is successfully generating the files.

      so do we need to mention anything in the plugin so that it recognizes the yaml file.

       

      Thanks,

      Pradeep

      Attachments

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              pradeep.kalvakolu Pradeep Kalvakolu
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: