spring-cloud / spring-cloud/spring-cloud-gateway

Missing configuration metadata in Gateway MVC

Open
#3,267 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

for: external-project
Dominant language
Java
Stars
4.9k
Forks
3.5k
Avg merge
20h 57m
Merged PRs (30d)
8

Description

Describe the bug

The configuration properties in the spring.cloud.gateway.mvc.routes-map group are missing metadata, resulting in IDEs not being able to validate values or suggest completions. It looks like something related to the fact that it's defined as a Map and includes an object which is defined in another class, not nested. The latter scenario would be typically solved with the @NestedConfigurationProperty annotation, but it doesn't support Maps. On the other hand, the spring.cloud.gateway.mvc.routes group (defined as a List) comes with the right metadata.

A possible solution would be to add the metadata explicitly in a additional-spring-configuration-metadata.json file. I'm not sure if there's some way in Spring Boot to support this scenario automatically via the Configuration Processor.

Screenshot 2024-02-15 at 18 59 16

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Gateway MVC configuration that defines the spring.cloud.gateway.mvc.routes-map group and compare its generated metadata with the spring.cloud.gateway.mvc.routes group. Check whether the Spring Boot configuration processor supports this Map case or whether additional-spring-configuration-metadata.json is needed. Done means IDE validation and completion work for the routes-map properties.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.