Repository navigation
refactor(api): Compose the HTTP surface without the host, and publish the OpenAPI document (#363) - #373
Merged
Conversation
… the OpenAPI document (#363) JWT and database settings are bound through options and validated at start, so registering the API's services needs no secret. AddApiSurface registers them; Program.cs validates the options before migrating and seeding, so a bad secret still stops start-up first. Anichron.OpenApiGenerator composes only the surface and writes the "v1" document to docs/openapi/v1.json. It replaces DI's EndpointDataSource with the app's own data sources, so it needs no UseEndpoints (ASP0014) and no suppression. scripts/derive-openapi.sh regenerates the document and, with --check, fails when it moved; CI runs the check beside the schema one. GET /api/v1/healthz stays out of the document: MapHealthChecks endpoints are invisible to ApiExplorer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… placeholder is equivalent (#363) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ery missing value (#363) DatabaseConfiguration now binds the raw connection settings without throwing; DatabaseConnectionSettings lists what is missing and builds the connection string. The Worker's GetConnectionString keeps throwing the first missing value, and the API validates the bound settings at start through DatabaseSettingsValidator. Review follow-ups: CLAUDE.md describes the surface, the generator and the document; the CI step loses its comment; the registration tests share one start-up helper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TimelineClock appended TimerArmed before FakeTimeProvider registered the timer. A test that advanced the clock as soon as it read TimerArmed could land in between on a slow runner; the timer was then scheduled from the advanced time, never fired, and the timeline went silent for 10 s. CI hit this in two WorkExecutorTests on PR #373. Recording after registration closes the gap. Co-Authored-By: Claude Opus 5.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 #363
Summary
The API's HTTP surface can now be built without the host. A generator that never starts a host publishes the OpenAPI document from it.
ValidateOnStartalone only fires insideRunAsync, after migration and seeding. The explicitValidate()keeps a bad JWT secret from reaching the database.JwtSettingsValidator, which reports every failure at once.JwtConfigurationis gone.DatabaseConfiguration.Bindreads the raw values without throwing.DatabaseConnectionSettingslists what is missing and builds the connection string. The API checks it throughDatabaseSettingsValidator. The Worker'sGetConnectionStringbehaves as before.GET /api/v1/healthzis not in the document. It was agreed on refactor(api): Compose the HTTP surface without the host, and publish the OpenAPI document #363: ApiExplorer cannot seeMapHealthChecksendpoints.Evidence
After: with no configuration at all,
scripts/derive-openapi.shwrites 25 paths, every mapped route except healthz.ApiDocumentTests.Document_DescribesEveryRouteButHealthzcompares the document with the route table. With the data-source override removed it fails, and with it in place it passes.scripts/derive-openapi.test.shpasses.--checkpasses on a current file and fails namingdocs/openapi/v1.jsonafter a deliberate edit, and regenerating restores the file.IStartupValidator:mutation-guard.shpasses.Merge Danger
Door: two-way
Nothing is deployed, and a revert restores the old wiring.
Blast Radius: start-up
DatabaseConfigurationis shared with the Worker. Its throwing path keeps the old messages and order, and its tests pass unchanged.v1.jsonfails the checks job.🤖 Generated with Claude Code