private static TopicCollection createTopics(OperationShape shape) {
        if (shape.hasTrait(SubscribeTrait.ID)) {
            SubscribeTrait trait = shape.expectTrait(SubscribeTrait.class);
            List<Topic> bindings = Collections.singletonList(trait.getTopic());
            return new TopicCollection(shape, trait, bindings);
        } else if (shape.hasTrait(PublishTrait.ID)) {
            PublishTrait trait = shape.expectTrait(PublishTrait.class);
            List<Topic> bindings = Collections.singletonList(trait.getTopic());
            return new TopicCollection(shape, trait, bindings);
        } else {
            return null;
        }
    }
Validates that labels are correct for MQTT topics on
{@code subscribe} and {@code publish} operations.

<ul>
    <li>Operation input is required when a topic has labels.</li>
    <li>Topic labels must be found in the input.</li>
    <li>The input must not contain extraneous labels.</li>
</ul>
smithy-mqtt-traits/src/main/java/software/amazon/smithy/mqtt/traits/validators/MqttTopicLabelValidator.java