Support Eloverblik-style specs — operationId synthesis, spec validation, and flattened endpoint namespaces - #63
Merged
Conversation
…verblikCustomerApiClient and EloverblikThirdPartyApiClient
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.
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
MontaClientsample wasmoved under a shared
sample/ThirdParty-Clients/folder.Changes
Specification handling
operationId— the extractor now derives a stablename from the HTTP method and path, and generates the corresponding parameter records
instead of skipping the operation.
OpenApiDocumentValidatorreports a clear diagnosticwhen
operationIdis missing rather than failing silently downstream.Endpoint layout (server)
EndpointDefinitionExtensions.csper path segment (each holding a single
Map{Segment}Endpoints()method), a singleroot
Endpoints/EndpointDefinitionExtensions.csnow contains one method per segment.segment-prefixed (
EmployeesEndpointDefinition), so they now live directly inEndpoints/under the root*.Generated.Endpointsnamespace instead of one folderper segment. Folder structure and namespace remain aligned, and the cross-namespace
usingblocks in both extension files are gone.IEndpointDefinitionis emitted once as its own shared file.Namespace/file alignment
PathSegmentHelper.ResolveEffectivePathSegment(...)so a redundant path segment collapses consistently across the Roslyn generators and
the CLI
CodeGenerationService.NamespaceBuilder.ToFileName(...)and aligned generated file names with theirnamespaces across the client, server, and CLI paths.
Samples
sample/ThirdParty-Clients/EloverblikCustomerApiClientandsample/ThirdParty-Clients/EloverblikThirdPartyApiClient.MontaClientintosample/ThirdParty-Clients/.Cleanup
is null/is not nullthroughout.Validation
dotnet build— succeeded, 0 warnings, 0 errors.test/Scenarios/**regenerated to match the new layout;the diffs are limited to file relocation and removed redundant
usingdirectives.Breaking changes
The generated server endpoint namespace changed from
{Project}.Generated.{Segment}.Endpointsto
{Project}.Generated.Endpointsfor endpoint definition classes. Consumers referencingthese types directly will need to update their
usingdirectives. The publicMapEndpoints()entry point is unchanged.