diff --git a/docs/templating.md b/docs/templating.md index eab039bb222..6de1780d171 100644 --- a/docs/templating.md +++ b/docs/templating.md @@ -820,15 +820,21 @@ Many generators (*those extending DefaultCodegen*) come with a small set of lamb - `lowercase` - Converts all of the characters in this fragment to lower case using the rules of the `ROOT` locale. - `uppercase` - Converts all of the characters in this fragment to upper case using the rules of the `ROOT` locale. +- `snakecase` - Converts text in a fragment to snake case. For example `once upon a time` to `once_upon_a_time`. - `titlecase` - Converts text in a fragment to title case. For example `once upon a time` to `Once Upon A Time`. +- `kebabcase` - Converts text in a fragment to snake case. For example `Once Upon A Time` to `once-upon-a-time`. +- `pascalcase` - Converts text in a fragment to snake case. For example `once upon a time` to `OnceUponATime`. - `camelcase` - Converts text in a fragment to camelCase. For example `Input-text` to `inputText`. - `uncamelize` - Converts text in a fragment from camelCase or PascalCase to a string of words separated by whitespaces. For example `inputText` to `Input Text`. +- `forwardslash` - Replaces all occurrences of `\/`, `\` and `//` in a fragment by `/`. +- `backslash` - Replaces all occurrences `/` in a fragment by `\`. +- `doublequote` - Prepends `"` to the beginning and appends `"` to the end of a fragment. - `indented` - Prepends 4 spaces indention from second line of a fragment on. First line will be indented by Mustache. - `indented_8` - Prepends 8 spaces indention from second line of a fragment on. First line will be indented by Mustache. - `indented_12` - Prepends 12 spaces indention from second line of a fragment on. First line will be indented by Mustache. - `indented_16` -Prepends 16 spaces indention from second line of a fragment on. First line will be indented by Mustache. -Lambda is invoked by `lambda.[lambda name]` expression. For example: `{{#lambda.lowercase}}FRAGMENT TO LOWERCASE{{/lambda.lowercase}}` to lower case text between `lambda.lowercase`. +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`. ## Extensions diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index dc72f0ae260..97e859e80c5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -404,6 +404,8 @@ public class DefaultCodegen implements CodegenConfig { * If common lambdas are not desired, override addMustacheLambdas() method * and return empty builder. * + * Corresponding user documentation: docs/templating.md, section "Mustache Lambdas" + * * @return preinitialized map with common lambdas */ protected ImmutableMap.Builder addMustacheLambdas() {