Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using @ConfigurationProperties without a prefix the first letter of the property is removed #79

Closed
katiaxyz opened this issue Jul 11, 2023 · 5 comments · Fixed by #82
Assignees
Labels
bug Something isn't working
Milestone

Comments

@katiaxyz
Copy link

katiaxyz commented Jul 11, 2023

Describe the bug
Wrong naming for the property when @ConfigurationProperties has empty prefix, i.e. empty group.

To Reproduce

Define the configuration as below:

@Component
@Data
@ConfigurationProperties
public class MyConfigurationProperties {
    /**
     * Generic property
     */
    private String myProperty = "propertyValue";
}

Expected behavior
The expected behaviour is to have a property named my-property as also present in spring-configuration-metadata.json and empty group in place of "+".

{
      "name": "my-property",
      "type": "java.lang.String",
      "description": "Generic property",
      "sourceType": "com.kat.configuration.MyConfigurationProperties",
      "defaultValue": "propertyValue"
    }

Screenshots
Screenshot 2023-07-11 at 16 59 40

Additional context
plugin configuration in pom.xml:

                <plugin>
		<groupId>org.rodnansol</groupId>
		<artifactId>spring-configuration-property-documenter-maven-plugin</artifactId>
		<version>0.6.0</version>
		<executions>
			<execution>
				<id>generate-adoc</id>
				<phase>process-classes</phase>
				<goals>
					<goal>generate-property-document</goal>
				</goals>
				<configuration>
					<type>ADOC</type>
					<outputFile>path-to-adoc-file</outputFile>
					<failOnError>true</failOnError>
				</configuration>
			</execution>
		</executions>
	</plugin>
@katiaxyz katiaxyz added the bug Something isn't working label Jul 11, 2023
@nandorholozsnyak
Copy link
Member

Hello @katiaxyz ,
Can you please try out it with the 0.6.1 version?

@nandorholozsnyak
Copy link
Member

It won't work with the 0.6.1 version. Let me fix that, it should be easy.

nandorholozsnyak added a commit that referenced this issue Jul 12, 2023
- Properties with groups without name is now properly rendered
nandorholozsnyak added a commit that referenced this issue Jul 12, 2023
…#82)

- Properties with groups without name is now properly rendered
@Riggs333
Copy link

@nandorholozsnyak Thanks for the quick fix!
As I'm running into the same issue with version 0.6.1, is there a plan when you will release the fix?

@nandorholozsnyak
Copy link
Member

Hello @Riggs333

I should have already released it, give me some time to pack the release together.

@nandorholozsnyak nandorholozsnyak added this to the 0.7.0 milestone Sep 9, 2023
@nandorholozsnyak
Copy link
Member

Hello @Riggs333

Sorry for the late reply, but the fix should be available in the newly released 0.7.0 version!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants