• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ruby-grape / grape / 39067849325 / 24
100%
master: 100%

Build:
Build:
LAST BUILD BRANCH: fix/values-proc-arity
DEFAULT BRANCH: master
Ran 17 Oct 2026 08:48PM UTC
Files 172
Run time 2s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

17 Oct 2026 08:41PM UTC coverage: 98.812% (+0.005%) from 98.807%
39067849325.24

Pull #3025

github

ericproulx
Add :md and :markdown formatters that render an object's to_markdown

Rails 8.1 registers text/markdown as Mime[:md] and adds
`render markdown: obj`, which calls obj.to_markdown. Grape::Formatter::Md
is the same contract for Grape: an object answering to_markdown is
rendered with it and a String is returned as is. Anything else raises
Grape::Exceptions::InvalidFormatter, so a client that negotiated Markdown
for a Hash body gets the default format instead of its #to_s.

.md and .markdown are both common Markdown extensions, so :md and
:markdown name the same format. Declaring either content type answers
both extensions and both ?format= spellings: the Formatter middleware
resolves the other name through ContentTypes::FORMAT_SYNONYMS to the one
the API declared, so a formatter, parser or error formatter declared for
that name applies too. The lookup runs only when the requested format is
not declared, so the common path is unchanged.
Grape::Formatter::Markdown registers Md's rendering under :markdown for
an API that declares that name.

Neither is a default content type; an API opts in with
`content_type :md, 'text/markdown; charset=utf-8'`. Errors keep the text
error formatter, and a text/markdown request body passes through
unparsed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pull Request #3025: Add :md and :markdown formatters that render an object's to_markdown

1487 of 1511 branches covered (98.41%)

Branch coverage included in aggregate %.

4501 of 4549 relevant lines covered (98.94%)

1254.41 hits per line

Source Files on job run-4.0-gemfiles/rack_3_0.gemfile - 39067849325.24
  • Tree
  • List 172
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 39067849325
  • 014f61ce on github
  • Prev Job for on feat/markdown-formatter (#39063956492.21)
  • Next Job for on feat/markdown-formatter (#39247739696.27)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc