openrewrite / openrewrite/rewrite-spring
Remove duplicate keys in yaml
Open
Nobody has claimed this yet.
recipe
- Dominant language
- Java
- Stars
- 403
- Forks
- 149
- Avg merge
- 2h 33m
- Merged PRs (30d)
- 10
Description
In Yaml, a key may contain . like a.b.c:true.
In Spring, the values are resolved like properties so multiple values may be mapped to a single configuration property.
---
a:
b:
c: true
b.c: ~
a.b:
c: false
@sanagaraj-pivotal requested a recipe to remove the duplicate keys
that prioritizes the last matched value.
Example
Choose 8080:
server.port: 9999
server:
port: 8080
Choose 9999:
server:
port: 8080
server.port: 9999
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file, test, or entry point is named in the issue. Start by locating the existing YAML recipe conventions and tests in rewrite-spring, then use the two ordering examples as acceptance cases: the last matching value should remain.
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