Repository navigation
BasicTemplateSet
Note: It's recommended to familiarize with key concepts before reading this article.
This is a base class for two predefined template sets used by Radish: SimpleTemplateSet and BootstrapTemplateSet.
The BasicTemplateSet class is needed as a layer because two template sets use the same templating logic, including common tags, replacement rules and template names.
The difference between template sets is only in appearance of output content.
Below is a comprehensive information about templates and their tags defined in BasicTemplateSet (and therefore in two descendant template sets).
Template for whole documentation page. Inherited from AbstractTemplateSet. Tags:
-
{{title}}— title of the documentation page. Will be displayed at the top of the documentation page. To set the title, please use aTitleproperty ofBasicTemplateSet -
{{methods-list}}— list of REST API methods. Will be replaced by rendering results ofMethodtemplate -
{{json-methods-list}}— will be replaced by JSON object that contains info about REST API methods. Used for navigation and for searching by methods.
Template for displaying information about group of methods. There are two tags defined:
-
{{title}}— for displaying group's title -
{{description}}— for displaying group's description
Template for displaying information about particular REST API method. Tags:
-
{{method}}— prints REST API method type defined byMethodAttribute.MethodType, like GET, POST, PUT and etc. -
{{id}}— prints unique id of a method defined byMethodAttribute.Id -
{{title}}— prints method title defined byMethodAttribute.Title -
{{description}}— prints a method description defined byMethodAttribute.Description -
{{request-parameters-list}}— will be replaced by table of request parameters template output -
{{request-body}}— will be replaced by request body description template output -
{{request-body-example}}— will be replaced by request body example template output -
{{response-body}}— will be replaced by response body description template output -
{{response-body-example}}— will be replaced by responsebody example template output -
{{response-codes-list}}— will be replaced by table of response codes template output
Template for rendering header and a table of request parameters of the method. Header of the table is a text: Request Parameters;. Only one tag is defined:
-
{{request-parameters-list}}— prints the table itself
Displays particular row from the table of parameters. Information for each row is taken from RequestParameterAttribute. Tags are:
-
{{name}}— prints name of the request parameter as defined byRequestParameterAttribute.Namevalue -
{{type}}— prints type of the parameter as defined byRequestParameterAttribute.Typevalue -
{{required}}— prints True or False word depend on value ofRequestParameterAttribute.Required -
{{description}}— prints description of the parameter as defined byRequestParameterAttribute.Descriptionvalue
Used for displaying documentation section that contains description of the request body. Section has header text: Request. Only one tag is defined:
-
{{description}}— prints the description of the request body
Template for documentation section with an example of REST API method request body. Has title Request example at the top. Uses tags:
-
{{data}}— prints request body data itself, in JSON, XML or raw text form, as defined byRequestBodyExampleAttribute.Datavalue -
{{data-format}}— prints request body data format type (Json, Xml or Raw) string depend onRequestBodyExampleAttribute.Formatvalue -
{{id}}— prints REST API method unique key
Used for displaying documentation section that contains description of the response body. Section has header text: Response. Only one tag is defined:
-
{{description}}— prints the description of the response body
Template for documentation section with an example of REST API method response body. Has title Response example at the top. Uses tags:
-
{{data}}— prints response body data itself, in JSON, XML or raw text form, as defined byResponseBodyExampleAttribute.Datavalue -
{{data-format}}— prints response body data format type (Json, Xml or Raw) string depend onResponseBodyExampleAttribute.Formatvalue -
{{id}}— prints REST API method unique key
Template for rendering header and a list of HTTP status codes of the method. Header of the table is a text: Response Codes;. Only one tag is defined:
-
{{response-codes-list}}— prints the list itself
Displays particular item from the list of response codes. Information for each item is taken from ResponseCodeAttribute. Tags are:
-
{{code}}— prints the HTTP status code as defined byResponseCodeAttribute.Codevalue -
{{description}}— — prints the explanation of HTTP status code as defined byResponseCodeAttribute.Descriptionvalue
Back to main page of the documentation.