kongchen / swagger-maven-plugin

JAX-RS & SpringMVC supported maven build plugin, helps you generate Swagger JSON and API document in build phase.
http://kongchen.github.io/swagger-maven-plugin/
Apache License 2.0
761 stars 451 forks source link

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

Open ldrahnik opened 1 year ago

ldrahnik commented 1 year ago

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>