Skip to content

Commit b55ae3c

Browse files
authored
update documentation about lambdas (#21241)
1 parent ecd5d25 commit b55ae3c

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

docs/templating.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -820,15 +820,21 @@ Many generators (*those extending DefaultCodegen*) come with a small set of lamb
820820
821821
- `lowercase` - Converts all of the characters in this fragment to lower case using the rules of the `ROOT` locale.
822822
- `uppercase` - Converts all of the characters in this fragment to upper case using the rules of the `ROOT` locale.
823+
- `snakecase` - Converts text in a fragment to snake case. For example `once upon a time` to `once_upon_a_time`.
823824
- `titlecase` - Converts text in a fragment to title case. For example `once upon a time` to `Once Upon A Time`.
825+
- `kebabcase` - Converts text in a fragment to snake case. For example `Once Upon A Time` to `once-upon-a-time`.
826+
- `pascalcase` - Converts text in a fragment to snake case. For example `once upon a time` to `OnceUponATime`.
824827
- `camelcase` - Converts text in a fragment to camelCase. For example `Input-text` to `inputText`.
825828
- `uncamelize` - Converts text in a fragment from camelCase or PascalCase to a string of words separated by whitespaces. For example `inputText` to `Input Text`.
829+
- `forwardslash` - Replaces all occurrences of `\/`, `\` and `//` in a fragment by `/`.
830+
- `backslash` - Replaces all occurrences `/` in a fragment by `\`.
831+
- `doublequote` - Prepends `"` to the beginning and appends `"` to the end of a fragment.
826832
- `indented` - Prepends 4 spaces indention from second line of a fragment on. First line will be indented by Mustache.
827833
- `indented_8` - Prepends 8 spaces indention from second line of a fragment on. First line will be indented by Mustache.
828834
- `indented_12` - Prepends 12 spaces indention from second line of a fragment on. First line will be indented by Mustache.
829835
- `indented_16` -Prepends 16 spaces indention from second line of a fragment on. First line will be indented by Mustache.
830836
831-
Lambda is invoked by `lambda.[lambda name]` expression. For example: `{{#lambda.lowercase}}FRAGMENT TO LOWERCASE{{/lambda.lowercase}}` to lower case text between `lambda.lowercase`.
837+
Some generators provide additional lambdas. Lambda is invoked by `lambda.[lambda name]` expression. For example: `{{#lambda.lowercase}}FRAGMENT TO LOWERCASE{{/lambda.lowercase}}` to lower case text between `lambda.lowercase`.
832838
833839
## Extensions
834840

modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,8 @@ public void processOpts() {
404404
* If common lambdas are not desired, override addMustacheLambdas() method
405405
* and return empty builder.
406406
*
407+
* Corresponding user documentation: docs/templating.md, section "Mustache Lambdas"
408+
*
407409
* @return preinitialized map with common lambdas
408410
*/
409411
protected ImmutableMap.Builder<String, Lambda> addMustacheLambdas() {

0 commit comments

Comments
 (0)