Support C#7 value tuples
See original GitHub issueAdd support for c# 7 value tuple. Example. Consider following action
public (IEnumerable<string> Collection, string Token) TestAction()
{
return (new string[] { "value1", "value2" }, "TokenValue");
}
expected definition:
"definitions": {
"ValueTuple[IEnumerable[String],String]": {
"type": "object",
"properties": {
"Collection": {
"type": "array",
"items": {
"type": "string"
}
},
"Token": {
"type": "string"
}
}
}
},
actual definition
"definitions": {
"ValueTuple[IEnumerable[String],String]": {
"type": "object",
"properties": {
"item1": {
"type": "array",
"items": {
"type": "string"
}
},
"item2": {
"type": "string"
}
}
}
},
Issue Analytics
- State:
- Created 6 years ago
- Reactions:6
- Comments:5 (1 by maintainers)
Top Results From Across the Web
C#7: Tuples - somewhat abstract
To support the new C#7 feature, there is a new tuple type that is more performant and better suited to the awesomeness that...
Read more >c# - C#7 value tuple/deconstruction asymmetry
Value tuples are the kind of syntactic-sugar feature where it does what it looks like it does, and never mind the implementation details....
Read more >Dissecting the tuples in C# 7 - Developer Support
Tuples can be “deconstructed” but only into “variable declaration” but not into “out var” or in the case block: var (x, y) =...
Read more >C# 7 Makes Tuples Cool!
So what's new with Tuples? In C# 7.0, there is a new feature that allows for multiple values to be returned from a...
Read more >Tuples in C#7
One of the nice features in C#7 is the support for Tuples as a lightweight datastructure using the System.ValueTuple NuGet package.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
ValueTuples can be treated as simple objects with well known property names matching values defined in generated TupleElementNamesAttribute. The only problem i can see is generating definition name.
any news here? im kinda having a problem here also… It is worth noting that if you use
List<KeyValuePair<string,string>>
the output isfield:[{key:string,value:string}]
, so why not haveList<(string Name, string Email)>
rendered asfield:[{Name:string,Email:string}]