Skip to content

$ref quotes while generating .yaml from java classes #67

Open
@Vazhenston

Description

@Vazhenston

Hi,
I'm trying to generate open-api.yaml from java classes with using springdoc-openapi-maven-plugin 1.4 But, unfortunately, when I use $ref in @Schema annotation, it does not generate quotes, but it's very important for me.
I tried to use ", ', `. I noticed, that maybe problem is in using some symbols in the beginning of $ref. For ex. if I use .(dot), it does not generate quotes, but if I use ,(comma) , it does. I suppose, that problem is in parsing from .json to .yaml.

My profile for pom.xml

<profile>
            <id>swagger-generate</id>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-maven-plugin</artifactId>
                        <configuration>
                            <jvmArguments>-Dspring.application.admin.enabled=true -Dspring.profiles.active=localdev
                            </jvmArguments>
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>start</goal>
                                    <goal>stop</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.springdoc</groupId>
                        <artifactId>springdoc-openapi-maven-plugin</artifactId>
                        <version>${springdoc-openapi-maven-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>integration-test</id>
                                <goals>
                                    <goal>generate</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <apiDocsUrl>http://localhost:8080/v3/api-docs.yaml</apiDocsUrl>
                            <outputDir>src/main/resources/swagger</outputDir>
                            <outputFileName>final_openapi.yaml</outputFileName>
                            <skip>false</skip>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

My class' element sample:

@Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED,
            ref = "./common/common_openapi.yaml#/components/schemas/RefObject")
    private RefObject icon;

My result in open-api.yaml

        icon:
          $ref: ./common/common_openapi.yaml#/components/schemas/RefObject 

Thank you,
Best wishes

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidThis doesn't seem right

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions