When accessing http://localhost:8080/raml this error is shown:

This is my App.java
package com.mycompany;
import org.jooby.Jooby;
import org.jooby.apitool.ApiTool;
public class App extends Jooby {
{
get("/", () -> "Hello World!");
use("/controller", Controller.class);
use(new ApiTool()
.raml("/raml")
);
}
public static void main(final String[] args) {
run(App::new, args);
}
}
And this my Controller.java
package com.mycompany;
import org.jooby.mvc.Consumes;
import org.jooby.mvc.GET;
import org.jooby.mvc.Path;
import org.jooby.mvc.Produces;
@Path("/controller")
@Consumes("application/x-www-form-urlencoded")
@Produces("application/json")
public class Controller {
@GET
public String salute() {
return "hey jooby";
}
}
The error is caused by the @Consumes("application/x-www-form-urlencoded")
I think the problem is that the generated api.raml (http://localhost:8080/raml/api.raml) is missing the mediaType property:
#%RAML 1.0
---
title: mycompany API
version: 1.0-SNAPSHOT
baseUri: http://localhost:8080/
protocols:
- HTTP
types: {}
/:
get:
responses:
200:
body:
type: string
/controller:
/controller:
get:
responses:
200: {}
If I change the code to @Consumes("application/json") it works correctly and the api.raml contains the mediaType property:
#%RAML 1.0
---
title: mycompany API
version: 1.0-SNAPSHOT
baseUri: http://localhost:8080/
mediaType:
- application/json
protocols:
- HTTP
types: {}
/:
get:
responses:
200:
body:
type: string
/controller:
/controller:
get:
responses:
200: {}
This also happens if the @Consumes("application/x-www-form-urlencoded") is at the method level.
Best regards
When accessing http://localhost:8080/raml this error is shown:

This is my App.java
And this my Controller.java
The error is caused by the
@Consumes("application/x-www-form-urlencoded")I think the problem is that the generated api.raml (http://localhost:8080/raml/api.raml) is missing the mediaType property:
If I change the code to
@Consumes("application/json")it works correctly and the api.raml contains the mediaType property:This also happens if the
@Consumes("application/x-www-form-urlencoded")is at the method level.Best regards