{% from "./sliced-string.html" import slicedString %} {% from "./tags.html" import tags %} {% from "./message.html" import message %} {% from "./example.html" import example %} {% from "./schema-prop.html" import schemaProp %} {% macro operation(operation, operationType, channelName, channel) %}

{% if operationType === 'publish' %} Pub {% endif %} {% if operationType === 'subscribe' %} Sub {% endif %} {{ slicedString(channelName) }}

{{ channel.description() | markdown2html | safe }}

{{operation.summary()}}

{{ operation.description() | markdown2html | safe }}
{% if channel.parameters() | length %}
Parameters
{% for parameterName, parameter in channel.parameters() %} {{ schemaProp(parameter.schema(), parameterName, odd=false, specialName=false, required=true) }} {% endfor %}
{% endif %} {% if operation.hasMultipleMessages() %}

Accepts one of the following messages:

{% for msg in operation.messages() %} {{ message(msg, showIndex=true, index=loop.index, open=false) }} {% endfor %} {% else %}

Accepts the following message:

{{ message(operation.message(0), showIndex=false, open=true) }} {% endif %} {{ tags(operation.tags()) }}

Examples

{% if operation.hasMultipleMessages() %} {% for msg in operation.messages() %} {{ example(msg, channelName) }} {% endfor %} {% else %} {{ example(operation.message(0), channelName) }} {% endif %}
{% endmacro %}