[csharp] Default folder structure#2752
Conversation
Aligns C# project outputs more with community accepted standards and leverges Nuget for package management. This also moves the generated C# sample code out of the test project's Lib folder. The output structure here was causing some issues with maintainability (e.g. had to update test project with generated code). (see: https://gist.github.com/davidfowl/ed7564297c61fe9ab814) Output for a project, IO.Swagger will now look like: . ├── IO.Swagger.sln ├── README.md ├── bin ├── build.bat ├── build.sh ├── docs ├── packages └── src ├── IO.Swagger │ └── packages.config └── IO.Swagger.Test └── packages.config This is a change from the Java-like src/main/csharp/IO/Swagger/etc structure and will be a breaking change for some.
In this commit, FormatTest.cs was modified manually. Unrelated to this commit, a Guid with default parameter of null was not marked nullable.
|
@jimschubert thanks for the PR. I've flagged this as a breaking change (without fallback) I'll review and let you know if I've any questions. (no need to rebase for now) |
Possible breaking change.
optionalProjectFileFlag handles the generation of csproj and sln
files. Not modifying the plurality of the option to reduce the
impact of the breaking change for existing settings:
optionalProjectFileFlag=true
=> generates additional .sln file
optionalProjectFileFlag=false
=> no change
unspecified
=> additional files (csproj, sln) may overwrite existing files
|
PR merged into master. Thanks again for the contribution. |
|
@wing328 minor typo. Should be |
|
@jimschubert what about changing the default namespace to just In the coming weekend, I'll also move those test cases for PetStore to the auto-generated test files (which won't be overwritten if the test file already exists). |
|
I think that's fine. However, if you rename the project after moving your test cases, they will be lost if the API naming convention ever changes (*Api to *Service for example). I think keeping them in a project that doesn't get auto generated is more maintainable because it would just take a search and replace to update it. Also, we could use the test project to include integration tests for bugs as a regression suite. I don't know that those would belong in the generated tests? |
|
Upgrade note from 2.1.6 to 2.2.0 Starting from 2.2.0, we've introduced the following breaking changes for C# API client:
|

This should be considered a breaking change.
Aligns C# project outputs more with community accepted standards and leverages Nuget for package management.
This also moves the generated C# sample code out of the test project's Lib folder. The output structure here was causing some issues with maintainability (e.g. had to update test project with generated code).
(see: https://gist.github.com/davidfowl/ed7564297c61fe9ab814)
Output for a project,
IO.Swaggerwill now look like:This is a change from the Java-like
src/main/csharp/IO/Swagger/etcstructure and will be a breaking change for some.@wing328