OpenAPITools / OpenAPITools/openapi-generator
[BUG] IndentedLambda not working across different OS
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Description
Intendtion is not working when generator is build on Unix OS (New Lines are LF) and Generator executed on Windows (New Lines are CRLF)
openapi-generator version
4.2.2
Steps to reproduce
- use
{{#lambda.indented}}somewhere - build and store jar of a customized generator on Unix OS
- run codegeneration on Windows OS
- {{#lambda.indented}} is not doing indention
Suggest a fix
Change line in org.openapitools.codegen.templating.mustache.IndentedLambda
String[] lines = text.split(System.lineSeparator());
to
String[] lines = text.split("\\r\\n|\\n|\\r");
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
Read org.openapitools.codegen.templating.mustache.IndentedLambda and reproduce the generator on Unix and Windows with an indented-lambda template. Check the handling of LF, CRLF, and CR line endings; done means indentation works consistently across those operating systems.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100