Skip to content

Feature set 133. - #60

Merged
jackfperryjr merged 1 commit into
mainfrom
features-133
Aug 5, 2026
Merged

Feature set 133.#60
jackfperryjr merged 1 commit into
mainfrom
features-133

Conversation

@jackfperryjr

Copy link
Copy Markdown
Owner

Scalar listed every endpoint twice

Not a Scalar bug — the OpenAPI document had each tag twice:

GET /api/characters   tags: ["Characters", "Characters"]
GET /api/cards        tags: ["Cards", "Cards"]

FastEndpoints auto-tags each operation with the first route segment,
title-cased, so /characters becomes Characters — exactly the tag the
endpoints already declare with .WithTags("Characters"). Scalar renders one
sidebar group per tag entry, so every operation appeared under its heading
twice.

AutoTagPathSegmentIndex = 0 drops the automatic pass. The explicit tags stay:
they are the ones that name "Cards" for /cards, and they survive a route
rename.

Theming

Scalar is styled through CSS custom properties, so the theme is a token file —
wwwroot/assets/scalar.css — mapping the palette games.css already defines,
with no rule written against a Scalar class name. ScalarTheme.DeepSpace
becomes None; a preset would layer its own gradient headings and background
flares under these tokens and the result reads as neither theme.

Two values deliberately differ from games.css. --accent #4285f4 is a
button background there, always under white text, but Scalar spends its accent
on links and small text directly on --bg, where it lands at ~3.6:1 and fails
AA — links use #8ab4f8, the same hue at ~7:1, while the solid blue stays the
button fill it already was. The gold picks out the title and active sidebar
row, matching .nav-brand.

Verification

Booted locally and read the generated spec: all 17 operations now carry exactly
one tag. The page serves its font links and stylesheet (200 text/css), and
the client config comes through as theme: "none", forceDarkModeState: "dark".

The rendered result is worth a glance before this goes out — the gold-on-active-row
is a judgment call.

🤖 Generated with Claude Code

Fix duplicate operations in the Scalar reference, and theme it.

Every endpoint was listed twice because every operation carried its tag
twice: FastEndpoints auto-tags on the first route segment, title-cased,
which is exactly the tag the endpoints already declare with WithTags.
Scalar renders a sidebar group per tag entry. The explicit tags stay;
AutoTagPathSegmentIndex goes to 0.

The reference is now themed from wwwroot/assets/scalar.css against the
same tokens games.css uses, with no preset underneath it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@jackfperryjr
jackfperryjr merged commit 80752e3 into main Aug 5, 2026
1 check passed
@jackfperryjr
jackfperryjr deleted the features-133 branch August 5, 2026 13:00
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.

1 participant