Repository navigation
Conversation
The generated code passed an optional parameter as it was and dropped the source of the field. A caller that passed nothing then sent no value for a required field.
A resource method passed an optional parameter as it was and dropped the source of the field. A caller that passed nothing then sent no value for a required field.
A resource method passed an optional parameter as it was and dropped the source of the field. The complete request also took a flattened list parameter as it was, so it did not compile.
The sample shows the source fallback in its generated Python, TypeScript and .NET. Its client source helper is `default_producer`, since it picks the Producer by where the code runs. Co-authored-by: Tim Conley <timothy.conley@temporal.io>
The optional `producer` parameters sit on top of the Store rename and the `append` result.
The docs of both `producer` fields match the API's WIT, which has the two optional parameters. Co-authored-by: Tim Conley <timothy.conley@temporal.io>
The sync gave `append` its optional `sequence`, and this branch puts it after `producer` as the API's WIT does. The generated samples were rebuilt, not merged by hand.
The sync brings the API's new offset and Workflow Producer comments, which this branch also needs.
Owner
Author
|
Replaced by temporalio#408. |
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.
This PR makes a field's
@nexus.sourcethe default of an optional resource method parameter.A resource method can take a parameter that has the name of a sourced request field. When that
parameter is
option<T>, the generated code passed it as it is. So a caller that gave no valuesent none, and the source was never used. With this change the caller's value wins, and the source
fills the field otherwise. The source is not evaluated when the caller passes a value. A required
parameter and a sourced field with no parameter behave as before.
The stream sample shows it. Its
appendandclosetake an optionalproducer.Python, TypeScript and .NET follow the rule. The .NET sample also needed a fix for a flattened
list parameter in a method that builds the full request.
Notes for the review.
records.
Streamneeds a Workflow context. Python andTypeScript have one each.