Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
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
- relates to
-
CAMEL-14966 restdsl-openapi maven plugin docs has old swagger parts
- Resolved