Courtesy of @YannCebron
@ConfigurationProperties("vet")
public class VetConfigProps {
@Name("aaa")
private String company;
@Name("aaa")
private String name;
public void setCompany(String company) {
this.company = company;
}
public String getCompany() {
return company;
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
}
The annotation processor completes successfully and generates the following JSON:
{
"groups": [
{
"name": "vet",
"type": "org.springframework.samples.petclinic.vet.VetConfigProps",
"sourceType": "org.springframework.samples.petclinic.vet.VetConfigProps"
}
],
"properties": [
{
"name": "vet.aaa",
"type": "java.lang.String",
"sourceType": "org.springframework.samples.petclinic.vet.VetConfigProps"
}
],
"hints": [],
"ignored": {
"properties": []
}
}
At runtime setting vet.aaa binds to the two annotated fields. I believe this should raise an error as two properties have the same ID (which they can't).
Courtesy of @YannCebron
The annotation processor completes successfully and generates the following JSON:
{ "groups": [ { "name": "vet", "type": "org.springframework.samples.petclinic.vet.VetConfigProps", "sourceType": "org.springframework.samples.petclinic.vet.VetConfigProps" } ], "properties": [ { "name": "vet.aaa", "type": "java.lang.String", "sourceType": "org.springframework.samples.petclinic.vet.VetConfigProps" } ], "hints": [], "ignored": { "properties": [] } }At runtime setting
vet.aaabinds to the two annotated fields. I believe this should raise an error as two properties have the same ID (which they can't).