private function sortPayloadFields()
    {
        if (isset($this->payload->operations)) {
            foreach ($this->payload->operations as $id => $operation) {
                foreach (['request', 'response'] as $opType) {
                    if (isset($operation->{$opType})) {
                        foreach (['headers', 'body'] as $fieldType) {
                            if (is_array($operation->{$opType}->{$fieldType})) {
                                usort(
                                    $operation->{$opType}->{$fieldType},
                                    function ($a, $b) {
                                        return strnatcmp(
                                            isset($a->key) ? $a->key : null,
                                            isset($b->key) ? $b->key : null
                                        );
                                    }
                                );
                            }
                        }
                    }
                }
            }
        }
    }