Closed Dalet closed 1 year ago
Ensure openapi.json is checked out with LF line endings via .gitattributes, because the tool always generates with LF.
This is done solely for the Github action, right, or is there any other reason for this enforcement?
Ensure openapi.json is checked out with LF line endings via .gitattributes, because the tool always generates with LF.
This is done solely for the Github action, right, or is there any other reason for this enforcement?
On Windows the file may be checked out with CRLF line endings (depending on git config). Since the generation tool always outputs LF, git could say the file has changed even though only the line endings changed.
This is not required by the CI stuff, this is just QoL for developers.
Changes summary
LeaderboardBackend.csproj
indendation according to the .editorconfig rules (2 spaces)openapi.json
file usingdotnet tool run swagger
. Since it needs to run the application to generate the file, it needs a valid configuration. So I added aswagger-gen.env
file to be used with the CLI tool.openapi.json
is checked out with LF line endings via.gitattributes
, because the tool always generates with LF.openapi.json
changes were not committed.Look at the latest commit separately to see the actual changes I made. The PR diff says I changed everything in the csproj because I fixed the indentation in the first commit.
Motivation
openapi.json
file inside the repository to be able to generate an API client without running the server.Currently the frontend team has to run the server locally to access the file which is not ideal.
I explicitly want the file to be committed manually (and not by the CI) because the OpenApi spec changes should be manually reviewed (unintended breaking changes, unexpected object serialization...).
I named the file
openapi.json
because it is recommended here: https://swagger.io/specification/ ("Document Structure" section)