Repository navigation
Conversation
…ient The server moves from the org.restlet.ext.smithy.server artifact into org.restlet.ext.smithy, which reads the SDK server, an optional dependency, on the class path: smithy-java 1.8.0 splits its package. A ServerProvider named restlet and a public SmithyServerBuilder let Server.builder() discover Restlet connectors, as SDK clients discover the transport. RPCv2 CBOR, a named consumer hosting a service and class-path discovery are now tested. Closes #1673 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Routes match the port and scheme of the connector that took a call, not those of its Host header. Path prefixes are only reordered when routes set nothing else, so that routes on hosts, ports or schemes keep their order. Endpoints with a path, query, fragment or user info, routes without services and null durations are rejected. The server provider now comes after the SDK's Netty server, so that adding the extension for its client doesn't change an application's server. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A call now goes to the first matching route whose services resolve its operation, so a longer prefix or an earlier route no longer hides the operations of later ones. Prefixes match the decoded path, endpoints need a host, IPv6 hosts lose their brackets, a failed start keeps its cause, and the provider reports a missing server-core clearly. The server class moves next to the adapter, holding each route with its adapter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Like the compiler, the Javadoc tool needs --add-reads org.restlet.ext.smithy=ALL-UNNAMED to resolve the smithy-java server types, which stay outside the module graph. 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 #1673. The Smithy server of #1638 moves into
org.restlet.ext.smithy, beside the client, and catches up with it.One artifact
SmithyServerAdapterandSmithyServerHostmove intoorg.restlet.ext.smithy, and theorg.restlet.ext.smithy.serverartifact goes away. It has never been released, sochanges.mdrewrites its Milestone 2 entry rather than recording a breaking change.smithy-java 1.8.0's
server-apiandserver-corestill split packagesoftware.amazon.smithy.java.server(smithy-java#1437), so the module can'trequirethem:server-coreis an optional dependency, so client-only users don't get it. Maven puts it on the class path, outside the module graph.--add-reads org.restlet.ext.smithy=ALL-UNNAMED.@SuppressWarnings("exports")covers the SDK types that the public API exposes.--add-reads, at compile time and at run time.SmithyModuleTestCase.namedConsumerHostsAServicecovers this case.Decision to check in review: whether this class-path-reading setup is acceptable in a named module until #1437 ships. The alternative is to keep a separate artifact without a descriptor.
Parity with the client
ClientTransportFactoryrestletServerProviderrestlet: by name, or when Netty is absent (priority -1, Netty 0)SmithyClientAdapterSmithyServerAdapterSmithyServerAdapter, and a new publicSmithyServerBuilder--add-readsSmithyServerBuilderimplements the SDK'sServerBuilder, with one Restlet server connector per endpoint (httporhttps) and one adapter per route:numberOfWorkerssets each route's concurrent-call limit.context(Context)passes connector parameters (HTTP/2, TLS), andmaxRequestBytesandmaxCallDurationset the adapters' limits.attachToscores routes. The port and scheme come from the connector that took the call, not from theHostheader.addService(path, …)mappings in aHashMap, so a/route could otherwise take calls meant for a longer prefix. Routes that also match hosts, ports or schemes keep the order they were added in.ServiceMatcheris not used for this. It ignores host names, and compares an unset port (null) with-1.server-core, the discovered provider fails with a clear error rather than aNoClassDefFoundErrorat build time.The provider is declared only in
META-INF/services. Aprovidesclause would need the split package, soServer.builder()discovers the builder on the class path only.Upstream findings (smithy-java 1.8.0, unchanged on
main)__type, so clients get aCallExceptionrather than the modeled error.cborModeledErrorsLoseTheirTypeUpstreampins it.@requiredmembers aren't rejected: the input comes with zero values. Range and length constraints are still enforced, andinvalidInputIsRejectedtests one.Tests (70, coverage met, no SpotBugs findings)
SmithyServerBuilderTestCase(new, 17): fallthrough to a route resolving the call, decoded prefixes, IPv6 addresses, a CBOR round trip over HTTP/1.1 and HTTP/2, validation, the upstream error bug, prefix, port, scheme and host routing, aHostheader naming another port, the longest prefix winning, host routes keeping their order, limits, invalid settings, single use, a failed start stopping what it started, and the provider.SmithyModuleTestCase: the server jars are now kept off the module path, and two child-JVM consumers are added:Notesservice;Server.builder()discovery and whose CBOR client uses the discovered transport.SmithyServerAdapterTestCasemoved unchanged, apart from the generated package.greeter,notesand the newcounter.🤖 Generated with Claude Code