Skip to content
This repository was archived by the owner on Feb 12, 2022. It is now read-only.

RuntimeException with Unknown type #256

Closed
kumaranae opened this issue May 17, 2017 · 3 comments
Closed

RuntimeException with Unknown type #256

kumaranae opened this issue May 17, 2017 · 3 comments

Comments

@kumaranae
Copy link

Hi Team,

Am getting the below RuntimeException when i tried with jaxrs-to-raml-maven-plugin for Jaxrs to RAML conversion. We are using Enum named SyncType as QueryParam.

Caused by: java.lang.RuntimeException: unknown type: class com.aek.nbi.api.SyncType
at org.raml.api.RamlTypes.fromType(RamlTypes.java:33)
at org.raml.jaxrs.emitters.ParameterEmitter.emit(ParameterEmitter.java:44)
at org.raml.emitter.IndentedAppendableEmitter.writeQueryParameters(IndentedAppendableEmitter.java:297)
at org.raml.emitter.IndentedAppendableEmitter.writeMethod(IndentedAppendableEmitter.java:197)
at org.raml.emitter.IndentedAppendableEmitter.writeResource(IndentedAppendableEmitter.java:120)
at org.raml.emitter.IndentedAppendableEmitter.writeResource(IndentedAppendableEmitter.java:124)
at org.raml.emitter.IndentedAppendableEmitter.writeApi(IndentedAppendableEmitter.java:88)
at org.raml.emitter.IndentedAppendableEmitter.emit(IndentedAppendableEmitter.java:73)
at org.raml.emitter.FileEmitter.emit(FileEmitter.java:59)
at org.raml.jaxrs.raml.core.OneStopShop.parseJaxRsAndOutputRaml(OneStopShop.java:81)
at org.raml.jaxrs.plugin.JaxRsToRamlMojo.confinedExecute(JaxRsToRamlMojo.java:120)
at org.raml.jaxrs.plugin.JaxRsToRamlMojo.execute(JaxRsToRamlMojo.java:77)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)

Below the SyncType enum,

public enum SyncType {
ASYNC, SYNC
}

Please let me know, how to add this enum in the RAMLTypes.

@jpbelang
Copy link
Contributor

I have a pull request that I suspect fixes this. I'll check this on the weekend.

@jpbelang
Copy link
Contributor

I've done a quick fix: QueryParameters did not support objects. Now they do (I think): I need to check properly, but I've checked Enums on QueryParameters. I still need to check HeaderParams and PathParams. Could you check this, though ?

@lapo-luchini
Copy link

Seems to be still there with FormParams:

Exception in thread "main" java.lang.RuntimeException: unknown type: class com.example.Name$Obj
        at org.raml.api.RamlTypes.fromType(RamlTypes.java:33)
        at org.raml.emitter.IndentedAppendableEmitter.writeFormParam(IndentedAppendableEmitter.java:238)
        at org.raml.emitter.IndentedAppendableEmitter.writeMethod(IndentedAppendableEmitter.java:163)
        at org.raml.emitter.IndentedAppendableEmitter.writeResource(IndentedAppendableEmitter.java:122)
        at org.raml.emitter.IndentedAppendableEmitter.writeResource(IndentedAppendableEmitter.java:126)
        at org.raml.emitter.IndentedAppendableEmitter.writeApi(IndentedAppendableEmitter.java:89)
        at org.raml.emitter.IndentedAppendableEmitter.emit(IndentedAppendableEmitter.java:74)
        at org.raml.emitter.FileEmitter.emit(FileEmitter.java:59)
        at org.raml.jaxrs.raml.core.OneStopShop.parseJaxRsAndOutputRaml(OneStopShop.java:81)
        at org.raml.jaxrs.cli.Main.main(Main.java:101)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants