Supports Micronaut 3.7.X
Please refer to the list of all features. To check the feature support for this converter.
- Supports Controller annotation combined with empty HttpMethod annotation
- Example:
@Controller("/todos")
class TodosController {
@Get
fun todos() { }
}
- Supports Controller annotation combined with HttpMethod annotation
- Example:
@Controller("/todo")
class TodosController {
@Get("/list")
fun todos() { }
}
-
Supports alias
uri
for HttpMethod annotation- Example:
@Get(uri = "/todos")
- Example:
-
Supports paths with leading and non-leading slash on both Controller and HttpMethod annotation
- Examples:
@Controller("/todos")
and@Controller("todos")
@Get("/todos")
and@Get("todos")
- Examples:
- Supports path parameter without annotation
- Examples:
@Controller("/todos/{id}")
class TodosController {
@Get
fun todos(id: String) { }
}
- Supports path parameter with annotation
- Examples:
@Controller("/todos/{id}")
class TodosController {
@Get
fun todos(@PathVariable("id") otherName: String) { }
}
- Supports using alias
name
- Examples:
@PathVariable(name = "id") otherName: String
- Examples:
- Supports query parameter without annotation
- Examples:
@Controller("/todos")
class TodosController {
@Get
fun todos(filter: String) { }
}
- Supports query parameter with annotation
- Examples:
@Controller("/todos")
class TodosController {
@Get
fun todos(@QueryValue("filter") filter: String) { }
}
- Supports setting the parameter required or optional based on the existence of a default value
- Examples:
@QueryValue("filter", defaultValue = "all") filter: String
- Examples:
- Supports required header parameter
- Examples:
@Controller("/todos")
class TodosController {
@Get
fun todos(@Header("allow-cache") otherName: String) { }
}
- Supports optional header parameter based on the existence of a default value
- Examples:
@Header("allow-cache", defaultValue = "true") otherName: String
- Examples:
-
Supports default media type
application/json
-
Supports single and multiple media type declarations in Controller annotation
-
Supports Consumes annotation with single and multiple media type declarations on class and function
-
Supports Consumes annotation overriding the value of the Controller annotation
-
Supports default media type
application/json
-
Supports single and multiple media type declarations in Controller annotation
-
Supports Produces annotation with single and multiple media type declarations on class and function
-
Supports Produces annotation overriding the value of the Controller annotation
Instantiate the converter with a package name which will be scanned recursively for controllers.
Example: MicronautConverter("io.github.ccjhr.hikaku")