Skip to content
Nikita Krasnikov edited this page Mar 27, 2022 · 3 revisions

Tamplate Tags

Use these tags to generate data.

Tag {{ Name }}

Key: {{ Name }}
Description: The Name tag is replaced by the name of the object or property
Example:
Text: "qwerty_abcdef"
Template: {{ Name }}
Result: qwerty_abcdef

Tag {{ Name.CamelCase }}

Key: {{ Name.CamelCase }}
Description: The Name.CamelCase tag is replaced by the name of the object or property in camelCase format
Example:
Text: "qwerty_abcdef"
Template: {{ Name.CamelCase }}
Result: qwertyAbcdef

Tag {{ Name.PascalCase }}

Key: {{ Name.PascalCase }}
Description: The Name.PascalCase tag is replaced by the name of the object or property in PascalCase format
Example:
Text: "qwerty_abcdef"
Template: {{ Name.PascalCase }}
Result: QwertyAbcdef

Tag {{ Name.SnakeCase }}

Key: {{ Name.SnakeCase }}
Description: The Name.SnakeCase tag is replaced by the name of the object or property in snake_case format
Example:
Text: "qwertyAbcdef"
Template: {{ Name.SnakeCase }}
Result: qwerty_abcdef

Tag {{ Name.KebabCase }}

Key: {{ Name.KebabCase }}
Description: The Name.KebabCase tag is replaced by the name of the object or property in kebab-case format
Example:
Text: "qwerty_abcdef"
Template: {{ Name.KebabCase }}
Result: qwerty-abcdef

Tag {{ Name.DotCase }}

Key: {{ Name.DotCase }}
Description: The Name.DotCase tag is replaced by the name of the object or property in dot.case format
Example:
Text: "qwerty_abcdef"
Template: {{ Name.DotCase }}
Result: qwerty.abcdef

Tag {{ Properties }}

Key: {{ Properties }}
Description: Tag no printer. The Properties tag start loop properties of object. The Name and Type tags act on the property inside the loop
Example:
JSON: {"qwerty_abcdef": 1}
Template: {{ Properties }}{{ Name }}{{ /Properties }}
Result: qwerty_abcdef

Tag {{ /Properties }}

Key: {{ /Properties }}
Description: The /Properties tag end loop properties of object.
Example:

Tag {{ Type }}

Key: {{ Type }}
Description: The Type tag is replaced by the type of the object or property. The type is formatted based on the specified programming language or custom mapping
Example:
JSON: {"qwerty_abcdef": 1}
Template: {{ Properties }}{{ Name }} {{ Type }}{{ /Properties }}
Result: qwerty_abcdef int

Tag {{ Type.Doc }}

Key: {{ Type.Doc }}
Description: Tag no printer. The Type.Doc tag is replaced by the type of the object or property. The type is formatted based on the specified programming language or custom documentation type mapping
Example:
Lang: PHP
JSON: {"qwerty_abcdef": [1]}
Template: {{ Properties }}{{ Name }} {{ Type.Doc }}{{ /Properties }}
Result: qwerty_abcdef int[]

Tag {{ Type.IsArray }}

Key: {{ Type.IsArray }}
Description: The Type.IsArray begin tag is condition if type == "array"
Example:
JSON: {"qwerty_abcdef": [1]}
Template: {{ Properties }}{{ Type.IsArray }}{{ Name }}[]{{ /Type.IsArray }}{{ /Properties }}
Result: qwerty_abcdef[]

Tag {{ /Type.IsArray }}

Key: {{ /Type.IsArray }}
Description: Close tag for {{ Type.IsArray }}
Example:

Tag {{ Type.IsObject }}

Key: {{ Type.IsObject }}
Description: The Type.IsObject begin tag is condition if type == "array"
Example:
JSON: {"qwerty_abcdef": {"a":true}}
Template: {{ Properties }}{{ Type.IsObject }}*{{ Name }}{{ /Type.IsObject }}{{ /Properties }}
Result: *qwerty_abcdef

Tag {{ /Type.IsObject }}

Key: {{ /Type.IsObject }}
Description: Close tag for {{ Type.IsObject }}
Example:

Tag {{ SPLIT }}

Key: {{ SPLIT }}
Description: Tag no printer. This tag marks the location of the subtemplate.
If a subtemplate is specified, then the generator generates all child objects according to the subtemplate
Example:
JSON: {"rootObject":{"childObject":{"qwerty":true}}}
Template: header text {{SPLIT}}{{ Properties }}{{ Name.PascalCase }} {{ Type }}{{ /Properties }}; {{ /SPLIT}}
Result: header text RootObject RootObject; ChildObject ChildObject; Qwerty bool;

Tag {{ /SPLIT }}

Key: {{ /SPLIT }}
Description: Close tag for {{ SPLIT }}
Example: