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.
What type of PR is this?
What this PR does / why we need it:
FromJson([]byte) error
Json(name string) ([]byte, error)
Json(name string) ([]byte, error)
And of course, there are tests for the new features.
As to why, the internal ISCs don't actually support Generics, as they don't know about these types to be able to deserialize into them directly. Proper support requires the ability to coerce the intermediate types into a Generic type. This can be done one of two ways - by using a string equivalent as you would on the CLI, or by implementing methods that can handle a JSON intermediate version on the Generic itself.
Given:
The following examples are equivalent for the sample
HostPort
type added in this PR to thealtsrc
tests:Third-party code that implements its own InputSourceContext may already support storing Generics in its internal structure, in which case the new code paths won't be hit, rendering full BC.
Testing
Tests were updated in the code to cover the new scenarios.
Release Notes