这是indexloc提供的服务,不要输入任何密码
Skip to content

Different line endings for generated swagger.json (CRLF) and swagger.yaml (LF) on Windows Git bash #893

@ldrahnik

Description

@ldrahnik

I run in project mvn compile on Windows 11 in Git bash and are generated files swagger.json with CRLF (cat -A swagger.json displayed as ^M$) and swagger.yaml with LF (cat -A swagger.yaml displayed as $).

 <plugin>
                <groupId>com.github.kongchen</groupId>
                <artifactId>swagger-maven-plugin</artifactId>
                <version>3.1.8</version>
                <configuration>
                    <apiSources>
                        <apiSource>
                            <springmvc>false</springmvc>
                            <locations>api.controllers</locations>
                            <schemes>http,https</schemes>
                            <basePath>/api</basePath>
                            <outputFormats>json,yaml</outputFormats>
                            <info>
                                <title>API</title>
                                <version>v1</version>
                                <description></description>
                            </info>
                            <swaggerDirectory>generated/swagger-ui</swaggerDirectory>
                        </apiSource>
                    </apiSources>
                </configuration>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions