Feature set 133. - #60
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scalar listed every endpoint twice
Not a Scalar bug — the OpenAPI document had each tag twice:
FastEndpoints auto-tags each operation with the first route segment,
title-cased, so
/charactersbecomesCharacters— exactly the tag theendpoints already declare with
.WithTags("Characters"). Scalar renders onesidebar group per tag entry, so every operation appeared under its heading
twice.
AutoTagPathSegmentIndex = 0drops the automatic pass. The explicit tags stay:they are the ones that name "Cards" for
/cards, and they survive a routerename.
Theming
Scalar is styled through CSS custom properties, so the theme is a token file —
wwwroot/assets/scalar.css— mapping the palettegames.cssalready defines,with no rule written against a Scalar class name.
ScalarTheme.DeepSpacebecomes
None; a preset would layer its own gradient headings and backgroundflares under these tokens and the result reads as neither theme.
Two values deliberately differ from
games.css.--accent#4285f4is abutton 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 failsAA — links use
#8ab4f8, the same hue at ~7:1, while the solid blue stays thebutton 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), andthe 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