apache / apache/netbeans

Micronaut should suggest micronaut-http-validation if http-related annotations are used

Open
#6,610 0 comments 0 reactions 0 assignees View on GitHub
kind:feature Micronaut needs:triage
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Description

If a project uses annotations like `io.micronaut.http.annotation.Get` and does not include `io.micronaut:micronaut-http-validation` annotation processor dependency, the following code can still compile:

```
@Get("/{idx}")
public Optional show(Long id) {
return genreService.findById(id);
}
```
the error will be discovered at runtime:

```
{"message":"Bad Request","_links":{"self":{"href":"/genres/1","templated":false}},"_embedded":{"errors":[{"message":"Required argument [Long id] not specified","path":"/id"}]}}
```

NBLS should detect the situation and suggest the dependency is added to the project.

### Use case/motivation

Better user assistance with Micronaut project development

### Related issues

_No response_

### Are you willing to submit a pull request?

Yes

Contributor guide

Open the contributing guide

Research direction

No source file or test is named. Start by locating the NBLS logic that inspects Micronaut annotations and proposes project dependencies; done means a project using the cited HTTP annotations without micronaut-http-validation receives a dependency suggestion.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.