Skip to content

Answer HTML from the show action by default - #39

Merged
6temes merged 1 commit into
masterfrom
fix/show-default-html
Sep 15, 2026
Merged

6temes merged 1 commit into
masterfrom
fix/show-default-html

Conversation

@6temes

@6temes 6temes commented Sep 15, 2026

Copy link
Copy Markdown
Owner

show declared its JSON format before its HTML one. A request carrying no Accept
header — curl, a bare fetch(), most HTTP client libraries — arrives as */*, which
matches every registered type, so Rails fell back to whichever was declared first.
Every other action in the engine already declares HTML first, so show was the lone
outlier.

The quieter consequence is that the JSON branch renders @object whole, including
columns the model config hides from the show view.

Clients that send an explicit Accept: application/json, or request the .json
extension, are unaffected. docs/UPGRADING.md carries the note with both forms.

Closes #32

`show` declared its JSON format before its HTML one, so a request carrying no
Accept header — curl, a bare fetch(), most HTTP libraries — arrived as */*,
matched every registered type, and got JSON, while every other action in the
engine answered HTML. The JSON branch also renders the record whole,
including columns the model config hides from the show view.

Clients sending an explicit Accept header or the .json extension are
unaffected.
@6temes
6temes marked this pull request as ready for review September 15, 2026 05:59
@6temes
6temes merged commit 014515c into master Sep 15, 2026
8 checks passed
@6temes
6temes deleted the fix/show-default-html branch September 15, 2026 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show action answers JSON to an Accept-less request while every other action answers HTML

1 participant