swagger-api / swagger-api/swagger-codegen
[csharp] XML comments include "--" and "-" erroneously
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
When building with -l csharp the resulting .csproj files contain illegal XML comments.
The error reported by Visual Studio is
The project file could not be loaded. An XML comment cannot contain '--', and '-' cannot be the last character.
Swagger-codegen version
2.4.14
Swagger declaration file content or url
Internal v2 docs.yaml (can't share file, but if something specific is needed informationally, let me know)
Command line used for generation
java -jar swagger-codegen-cli.jar generate -i $WORKPATH/apidocs/docs.yaml -l csharp
Steps to reproduce
(Using WSL2 with Ubuntu 20.04LTS on Windows 10)
Run above command line in and try to open resulting sln file in Visual Studio
Related issues/PRs
Seems to be duplicate of 3354, but that was closed a long time ago so might be a different cause now.
Suggest a fix/enhancement
It looks like the escaping is not working correctly. I'm not sure what needs to be fixed to get it to work properly.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the documented Java command and the available Swagger declaration. Inspect the generated .csproj comments for the illegal '--' or trailing '-' sequences, then verify that the generated solution opens successfully in Visual Studio without the XML parsing error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, java
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100