Questions tagged [micronaut-rest]

85 questions
2
votes
1 answer

How to get reactive streams in Micronaut?

In Spring Boot, for Webflux projects, we request a stream of data by sending a header - "Accept: application/stream+json" in the HTTP Request. If we send, "Accept: application/json", we get get a valid Json. In Micronaut, however, if I send "Accept:…
Anoop Hallimala
  • 625
  • 1
  • 11
  • 25
2
votes
1 answer

Cannot validate view.model.product.ProductSearchCriteria. No bean introspection present. Please add @Introspected to the class

Custom validator issue No bean introspection present. Please add @Introspected to the class and ensure Micronaut annotation processing is enabled not working Micronaut 2.2.1 @Retention(RetentionPolicy.RUNTIME) @Target({ METHOD, FIELD,…
San Jaisy
  • 15,327
  • 34
  • 171
  • 290
2
votes
1 answer

"Required argument not specified" while posting a json with date

Context: I am using Kotlin with Micronaut and for this project I will not add Spring dependencies. I created successfully a Hello Word enpoint and I can post to it from Postman. The issue started when I evolulated the data to have birthday…
Jim C
  • 3,957
  • 25
  • 85
  • 162
2
votes
0 answers

Micronaut - More than 1 route matched the incoming request

I'm having an issue testing a controller but I haven't been able to reproduce the problem in a simple application. When I run the app, it works fine. I have a controller: public interface HomeOperations { @Post // Micronaut's Post …
Miguel Jiménez
  • 1,276
  • 1
  • 16
  • 24
1
vote
1 answer

Write custom authentication function in Micronaut

In Micronaut I have a very basic requirement. I just want to decode the JWT token and check if one key is present in the claims map. I have not come across any implementation where we are just validating the token. I have implemented the custom…
Rahul Khanna
  • 316
  • 3
  • 12
1
vote
1 answer

exceptionOnErrorStatus in ClientConfiguration of Declarative Client not being applied in Micronaut version 3.7.3

I have provided a configuration class to my Declarative HttpClient, to force throwing an exception on error (status>400), or maybe I misunderstood the exceptionOnErrorStatus configuration option. @Client(value = "/", configuration =…
Luis Muñiz
  • 4,649
  • 1
  • 27
  • 43
1
vote
1 answer

Micronaut @Error annotation not working (micronaut 3.7.3)

I'm trying to improve the error handling in a controller by using the @Error annotation. @Get(uri = "/{id}") @Secured("ROLE_VIEW") HttpResponse show(Long id) { try { ok(authorService.get(id).get()) …
Luis Muñiz
  • 4,649
  • 1
  • 27
  • 43
1
vote
0 answers

AccessRefreshToken not serialized while using Micronaut Serialization

I have a Java-library which uses below dependencies dependencies { annotationProcessor "io.micronaut:micronaut-inject-java:3.5.3" annotationProcessor "io.micronaut:micronaut-validation:3.5.3" …
San Jaisy
  • 15,327
  • 34
  • 171
  • 290
1
vote
1 answer

How to set OpenApi config via code and not using annotation in Micronaut

I have a springboot application and I want to convert to Micronaut, but how I config the openapi via code, like in this article https://keepgrowing.in/java/springboot/how-to-secure-spring-boot-swagger-ui-with-basic-authentication/ Code…
1
vote
2 answers

How to create a Micronaut project with JPA Entity from external classes from another jar

I have a Micronaut project, and I'm trying to build the project with my external Entity classes which are in Spring JPA added on dependency in pom.xml, but I'm always having an error: Caused by:…
1
vote
1 answer

Problem with bean instantiation using @Repository micronaut data annotation

I'm approaching Micronaut framework to create a program to interact with a database. I'm new to gradle project configuration etc. so it could be a problem related to this. I divided my project in two modules: main(where the Application class is) and…
ale9600
  • 11
  • 1
1
vote
0 answers

Micronaut possibility to exclude endpoints from http logger

I enabled logging http traffic by . But I want exclude health endpoint from logging. Is there some config for it? I found some settings at access logger, but it didn't affect…
Andrew Sneck
  • 724
  • 9
  • 18
1
vote
1 answer

Spring's @WebMvcTest equivalent in micronaut

How can I run only controller in @MicronautTest without running repositories/services only mocking them like in spring @WebMvcTest do? @RestController @RequestMapping("/api") public class EmployeeRestController { @Autowired …
Andrew Sasha
  • 1,254
  • 1
  • 11
  • 21
1
vote
1 answer

Streaming file blocks event loop?

A project in micronaut 2.0.1 has a function to expose some resource. The resource is streamed with an InputStream from another service by HTTP. @ExecuteOn(TaskExecutors.IO) @Status(HttpStatus.OK) @Get public StreamedFile export() throws…
zibi
  • 3,183
  • 3
  • 27
  • 47
1
vote
1 answer

Exception stacktrace and cause not mapped to the custom global exception handling in Micronaut 2.5.8

Trying to handle the global exception handling in Micronaut, but the exception stack trace and cause are not thrown to the ExceptionHandler. public class GlobalException extends RuntimeException{ public GlobalException(Throwable…
San Jaisy
  • 15,327
  • 34
  • 171
  • 290