Skip to content

Commit

Permalink
add displayName to rendered headers
Browse files Browse the repository at this point in the history
  • Loading branch information
jenschude committed Apr 11, 2024
1 parent 9fe96a2 commit 45689d9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,17 @@ fun AnyType.renderType(withDescription: Boolean = true): String {
} else {
""
}
val displayName = if ((this.isInlineType || this.isScalar()) && this.displayName?.value.isNullOrBlank().not()) {
"""
|
|displayName: ${this.displayName.value.trim()}
""".trimMargin()
} else {
""
}
return """
|${this.renderTypeFacet()}
|$builtinType
|$builtinType$displayName
|$description
""".trimMargin().trimEnd()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ class TestCodeGenerator {
FOO:
type: string
(builtinType): string
displayName: Foo
required: true
body:
application/json:
Expand Down
1 change: 1 addition & 0 deletions languages/ramldoc/src/test/resources/curlexample.raml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ types:
headers:
FOO:
type: string
displayName: Foo
required: true
responses:
200:
Expand Down

0 comments on commit 45689d9

Please sign in to comment.