Skip to content

Missing Introspected annotation for bean validation #5

@Tucos

Description

@Tucos

Hi,

Small note: this issue is not important to me; I can stick with spring or add the hibernate validator for the current project.

Micronaut requires an Introspected annotation on POJOs that need validation (ref micronaut docs). Currently this annotation is missing from POJOs generated by openapi-processor-micronaut.

I've created a small project that demonstrates the problematic behavior. It's a bare micronaut project with openapi-processor added. The API has a single endpoint that requires a body with a single required property. The one and only testcase EndpointControllerTest calls the endpoint with that parameter missing.

This test fails with the following error: Cannot validate com.example.api.model.EndpointBody. No bean introspection present. Please add @Introspected to the class and ensure Micronaut annotation processing is enabled. After adding the annotation to the generated EndpointBody the test succeeds. Adding the hibernate validator to the project dependencies will also make it succeed.

I've added an example integration test in this commit: Tucos/openapi-processor-micronaut@ee1616b.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions