Commit messages end up with a trailing newline over REST API

I’m using the following API endpoint over OAuth2: api/v4/projects/${projectID}/repository/commits to list commits in a directory. However, there is a trailing newline at the commit message, which is not present in the actual commit message in git.

Is this intentional?