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

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

{% if channel.description() is not none %}
{{ channel.description() | markdown2html | safe }}
{% endif %} {% if operation.summary() is not none %}

{{operation.summary()}}

{% endif %} {% if operation.description() is not none %}
{{ operation.description() | markdown2html | safe }}
{% endif %} {% if channel.parameters() is not none %} {% if channel.parameters() | length %}
Parameters
{% for parameterName, parameter in channel.parameters() %} {{ schemaProp(parameter.schema(), parameterName, odd=false, specialName=false, required=true) }} {% endfor %}
{% endif %} {% 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(), 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(), channelName) }} {% endif %}
{% endmacro %}