{{! interface_types.mustache : types for }} (****************************************************************** Interface input types: {{META.desc}} - modelData {{META.modelData}} - template {{META.template}} *******************************************************************) {{#interfaces}}{{! Add fixed string 'REQUEST: which can be used to extract definition from specification code }} (* REQUEST: {{interface_operation}} --> TLA process: {{#SPEC_NAME}}processes.{{interface_operation}}{{/SPEC_NAME}} *) {{#SPEC_NAME}}interface_types.{{interface_operation}}{{/SPEC_NAME}} == [{{#parameter_definitions}} {{>name_parameter_definition.mustache}}: {{#isArray}}SUBSET {{/isArray}}{{#SPEC_NAME}}{{metatype}}.{{type}}{{/SPEC_NAME}}{{_comma}}{{/parameter_definitions}}{{! Empty parameter definition (passes swagger schema validation). ouput 'dummy : {Nil}' }}{{^parameter_definitions.length}}dummy: {Nil}{{/parameter_definitions.length}} ]{{! Add fixed string END-OF-REQUEST }} (* END-OF-REQUEST *) {{/interfaces}} \* end of Interface input types (****************************************************************** Interface response types: {{META.desc}} - modelData {{META.modelData}} - template {{META.template}} *******************************************************************) {{#interfaces}} {{! Add fixed string 'RESPONSE: which can be used to extract definition from specification code }} (* RESPONSE: {{interface_operation}} --> TLA process: {{#SPEC_NAME}}processes.{{interface_operation}}{{/SPEC_NAME}} *) {{#SPEC_NAME}}interface_response_types.{{interface_operation}}{{/SPEC_NAME}} =={{! When something defined as a response i.e. 'response_definitions.length' exists }}{{! No new line here }}{{#response_definitions.length}} [ {{/response_definitions.length}}{{#response_definitions}} {{>name_parameter_definition.mustache}}: {{#SPEC_NAME}}{{metatype}}.{{type}}{{/SPEC_NAME}}{{_comma}} {{/response_definitions}}{{! NO new line here }}{{#response_definitions.length}}]{{/response_definitions.length}}{{! When no response defined i.e. 'response_definitions.length' return false }}{{^response_definitions.length}} { Nil }{{/response_definitions.length}}{{! Put a comment in the end }}{{! Add fixed string END-OF-RESPONSE: to mark end of response }} (* END-OF-RESPONSE *) {{/interfaces}}