Give IconLibrary a name, and the server a way to report it (#111) - #113
Merged
Merged
Conversation
Since #93 the server names no library: it runs against whichever one is on its classpath, which is what lets one build serve Standard, Hallux or BattleOrder. That left nothing able to say which one it got. With an instance per library planned, each on its own subdomain, "which library is this" has to be answerable from outside rather than inferred from which symbol sets happen to turn up in a listing. So IconLibrary declares getName(), the generator's template emits it from the library prefix it was generated with, and a new /info/library endpoint returns it alongside the symbol set count. Deliberately not getVersion(): getVersions() already means something else on this interface - an APP-6 edition, SIDC positions 1-2 - and the two would read as a pair. The generated libraries were regenerated rather than hand-patched; the only change in either was the new method. 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.
Closes #111.
Since #93 the server names no library — it runs against whichever one is on its classpath, which is what lets one build serve any of them. That left nothing able to say which one it actually got. With an instance per library planned, each on its own subdomain (#93, #112), "which library is this one running" needs to be answerable from outside rather than inferred from which symbol sets happen to turn up in a listing.
What's here
IconLibrary.getName()— declared on the interface. Returns the library's own name:Standard,Hallux,BattleOrder.IconLibrary.ftl— emits it from thelibraryPrefixthe library was generated with, which is what names the class too, so a new library gets a correct name for free rather than having one to remember to set./info/libraryonIconGeneratorController, returning a newLibrarySummaryrecord — the name plus the symbol set count.DynamicIconLibrary(editor) and the test fixture answerDynamicandFake.Deliberately not
getVersion().getVersions()already means something else on this interface — an APP-6 edition, SIDC positions 1–2 — and the singular/plural pair would read as one concept split in two. Noted in the javadoc so it doesn't get "tidied" later.Verification
Both generated libraries were regenerated rather than hand-patched (per CLAUDE.md).
git diffconfirmed the only change in either was the new method, returning"Standard"and"Hallux"respectively.Against the packaged server:
mvn verifygreen across all seven modules — 84 tests, Spotless clean, both fragment checks clean (6,258 fragments, 0 off the shape).🤖 Generated with Claude Code