Pin multi-outcome command responses against Arc for .NET - #91
Merged
Merged
Conversation
…-outcome # Conflicts: # ContractTests/Client/package.json # Documentation/index.md # Documentation/reference/packages.md # README.md # Source/Chronicle/package.json # Source/CodeAnalysis/package.json # Source/Core/package.json # Source/Cratis/package.json # Source/Drizzle/package.json # Source/Express/package.json # Source/Fastify/package.json # Source/Hono/package.json # Source/MongoDB/package.json # Source/Testing/package.json # Source/Tools/ProxyGenerator/package.json # yarn.lock
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.
Arc for TypeScript 0.39.0 pins how commands with several possible outcomes behave on the wire against Arc for .NET, and lets the proxy generator accept outcome alternatives that share one client type. npm publication remains disabled.
Added
OneOf/Resultalternatives: a DTO or primitive answers 200 with it asresponse, a validation branch answers 400, a denial 403, a tuple's validation result replaces its response, and no discriminator is added to the wire. An arbitraryResulterror DTO in .NET is an ordinary 200 response; in TypeScript, return it withresponse(...)to get the same result, or userejected(...)/denied(...)for failures. The suite now runs 279 checks.Changed
Outcomehelpers, promises, aliases and nested tuples, and accepts alternatives that resolve to the same client type. Literal unions such asboolean, enums and'a' | 'b', with or withoutnull/undefined, keep their full type, distinct concepts fall back to their shared primitive, and arrays that mix Chronicle event types are omitted from the client response as before.boolean, enums or literal unions now names the element type, so OpenAPI describes their data.Refs #90