Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #1390
Closed
Open
Issue created Nov 06, 2018 by Administrator@rootContributor

[C#] csharp client generation does not handle "sourceFolder" config setting

Created by: grmcdorman

Description

If the source folder setting is changed via a configuration file, csharp client generation still generates some files with references to 'src'.

openapi-generator version

main

OpenAPI declaration file content or url

Not applicable. Configuration file, for -c option:

{
"sourceFolder":  "."
}

or any sourceFolder setting other than src.

Command line used for generation

java -jar openapi-generator-cli.jar generate -i swagger.json -l csharp -o ClientAPI -c .\openapi-generation-parameters.json

Steps to reproduce

Generate code. Try to build; it will fail.

Related issues/PRs

None.

Suggest a fix/enhancement

There are a significant number of .mustache files which have the literal string src instead of the {{sourceFolder}} macro; replacing these should fix the issue [not tested]:

Search "src" (12 hits in 5 files) compile-mono.sh.mustache (2 hits) Line 43: ${nuget_cmd} install src/{{packageName}}/packages.config -o packages; Line 68: -recurse:'src/{{packageName}}/*.cs'
compile.mustache (2 hits) Line 14: .\nuget.exe install src{{packageName}}\packages.config -o packages Line 26: %CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\JsonSubTypes.dll;bin\RestSharp.dll;System.ComponentModel.DataAnnotations.dll {{#generatePropertyChanged}}/r:bin\Fody.dll;bin\PropertyChanged.Fody.dll;bin\PropertyChanged.dll{{/generatePropertyChanged}} /target:library /out:bin{{packageName}}.dll /recurse:src{{packageName}}*.cs /doc:bin{{packageName}}.xml mono_nunit_test.mustache (3 hits) Line 10: rm src/{{{packageName}}}.Test/bin/Debug/{{{packageName}}}.Test.dll 2> /dev/null Line 15: mono nuget.exe install src/{{{packageName}}}.Test/packages.config -o packages Line 22: mono ./packages/NUnit.Runners.2.6.4/tools/nunit-console.exe src/{{{packageName}}}.Test/bin/Debug/{{{packageName}}}.Test.dll nuspec.mustache (3 hits) Line 46: <file src="....\README.md" target="" /> Line 47: <file src="....\docs**." target="docs" /> Line 49: <file src="....\packages\Fody.1.29.4\build\portable-net+sl+win+wpa+wp\Fody.targets" target="build" /> Solution.mustache (2 hits) Line 5: Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{packageName}}", "src{{packageName}}{{packageName}}.csproj", "{{packageGuid}}" Line 7: {{^excludeTests}}Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{testPackageName}}", "src{{testPackageName}}{{testPackageName}}.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}"

Assignee
Assign to
Time tracking