Skip to content

Support Eloverblik-style specs — operationId synthesis, spec validation, and flattened endpoint namespaces - #63

Merged
davidkallesen merged 7 commits into
mainfrom
feature/support-Eloverblik-client
Aug 17, 2026
Merged

Support Eloverblik-style specs — operationId synthesis, spec validation, and flattened endpoint namespaces#63
davidkallesen merged 7 commits into
mainfrom
feature/support-Eloverblik-client

Conversation

@davidkallesen

Copy link
Copy Markdown
Contributor

Summary

Adds support for generating clients from the Eloverblik APIs, which exposed several
gaps in the generator: specs without operationId, missing quoting on string defaults,
and an endpoint file/namespace layout that produced excessive nesting and one-file folders.

Two new sample projects (EloverblikCustomerApiClient, EloverblikThirdPartyApiClient)
are included as living regression coverage, and the existing MontaClient sample was
moved under a shared sample/ThirdParty-Clients/ folder.

Changes

Specification handling

  • Synthesize operations without operationId — the extractor now derives a stable
    name from the HTTP method and path, and generates the corresponding parameter records
    instead of skipping the operation.
  • Improved spec validationOpenApiDocumentValidator reports a clear diagnostic
    when operationId is missing rather than failing silently downstream.
  • Fixed default string values — string defaults are now emitted quoted.

Endpoint layout (server)

  • Consolidated endpoint mapping — instead of one EndpointDefinitionExtensions.cs
    per path segment (each holding a single Map{Segment}Endpoints() method), a single
    root Endpoints/EndpointDefinitionExtensions.cs now contains one method per segment.
  • Flattened endpoint definitions — endpoint definition classes are already
    segment-prefixed (EmployeesEndpointDefinition), so they now live directly in
    Endpoints/ under the root *.Generated.Endpoints namespace instead of one folder
    per segment. Folder structure and namespace remain aligned, and the cross-namespace
    using blocks in both extension files are gone.
  • IEndpointDefinition is emitted once as its own shared file.

Namespace/file alignment

  • Centralized segment resolution via PathSegmentHelper.ResolveEffectivePathSegment(...)
    so a redundant path segment collapses consistently across the Roslyn generators and
    the CLI CodeGenerationService.
  • Added NamespaceBuilder.ToFileName(...) and aligned generated file names with their
    namespaces across the client, server, and CLI paths.

Samples

  • Added sample/ThirdParty-Clients/EloverblikCustomerApiClient and
    sample/ThirdParty-Clients/EloverblikThirdPartyApiClient.
  • Moved MontaClient into sample/ThirdParty-Clients/.

Cleanup

  • Switched to is null / is not null throughout.

Validation

  • dotnet build — succeeded, 0 warnings, 0 errors.
  • Integration tests — 505 passed, 0 failed from a clean output directory.
  • Verify snapshots under test/Scenarios/** regenerated to match the new layout;
    the diffs are limited to file relocation and removed redundant using directives.

Breaking changes

The generated server endpoint namespace changed from {Project}.Generated.{Segment}.Endpoints
to {Project}.Generated.Endpoints for endpoint definition classes. Consumers referencing
these types directly will need to update their using directives. The public
MapEndpoints() entry point is unchanged.

@davidkallesen davidkallesen reopened this Aug 17, 2026
@davidkallesen
davidkallesen merged commit 5a2c3ec into main Aug 17, 2026
14 checks passed
@davidkallesen
davidkallesen deleted the feature/support-Eloverblik-client branch August 17, 2026 11:09
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