swagger-api / swagger-api/swagger-codegen
[Elm] Description conversion to function comment can be improved
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
Comments describing a function or declaration start with {-| instead of {-. They belong to the next declaration.
{-| Representation of fast immutable arrays. You can create arrays of integers
(`Array Int`) or strings (`Array String`) or any other type of value you can
dream up.
-}
type Array a = Array
https://github.com/elm-lang/core/blob/5.1.1/src/Array.elm#L39-L43
The codegen will generate this (including newlines) instead (the | character is missing):
{-
My description
-}
and if there is no description at all, the output will be a comment with no content. Instead the comment should be omitted.
{-
-}
Swagger-codegen version
2.3.1
Suggest a fix/enhancement
The parentheses are hardcoded. There could be more occurrences.
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
Start with modules/swagger-codegen/src/main/resources/elm/model.mustache and elm/api.mustache, then compare their description output with the Elm example in the issue. Update the templates so descriptions use the function-comment marker and empty descriptions produce no comment; check both generated outputs for the unwanted blank comment.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- elm
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100