rodnansol / spring-configuration-property-documenter

Tool to document Spring Configuration Properties - Leave us a feedback: https://github.com/rodnansol/spring-configuration-property-documenter/discussions/74
Apache License 2.0
39 stars 5 forks source link

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

Closed katiaxyz closed 1 year ago

katiaxyz commented 1 year ago

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>
nandorholozsnyak commented 1 year ago

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

nandorholozsnyak commented 1 year ago

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

Riggs333 commented 1 year ago

@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 commented 1 year ago

Hello @Riggs333

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

nandorholozsnyak commented 1 year ago

Hello @Riggs333

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