You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2020/04/28 14:29:00 UTC

[jira] [Assigned] (CAMEL-14965) camel-restdsl-openapi-plugin not working with yaml

     [ https://issues.apache.org/jira/browse/CAMEL-14965?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen reassigned CAMEL-14965:
-----------------------------------

    Assignee: Claus Ibsen

> camel-restdsl-openapi-plugin not working with yaml
> --------------------------------------------------
>
>                 Key: CAMEL-14965
>                 URL: https://issues.apache.org/jira/browse/CAMEL-14965
>             Project: Camel
>          Issue Type: Bug
>          Components: tooling
>            Reporter: Pradeep Kalvakolu
>            Assignee: Claus Ibsen
>            Priority: Minor
>              Labels: help-wanted
>             Fix For: 3.3.0
>
>
> 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



--
This message was sent by Atlassian Jira
(v8.3.4#803005)