Open elementuse opened 5 years ago
You're talking about this property in C#?
in typescript. is this code generator support?
Yes, but you need something like this in typescript?
yes. using typescript, my data was filtered out by the proxy class.
Yep, not implemented yet...
How to avoid this problem and let my data display? is there any good way?
I think the only way to fix that right now is to use interfaces instead of classes for DTOs...
What's the status on this?
Not sure if it belongs here or in a new issue, but the code in the generated TypeScript code to handle JsonExtensionData
doesn't seem to follow spec. It expects there to be a property "extensions" in the JSON data but that will not be there in correctly generated JSON, as specified in the documentation for the property Extensions
on ProblemDetails
:
Extension members appear in the same namespace as other members of a problem type.
So for example, given this constructed ProblemDetails
:
new ProblemDetails
{
// ...
Extensions =
{
["CustomExtension"] = "custom value"
}
};
The following JSON will be generated (standard fields omitted):
{
"CustomExtension": "custom value"
}
However, NSwag's TypeScript code expects this:
{
"extensions": {
"CustomExtension": "custom value"
}
}
Not sure how the C# JSON libraries handle them, but I suppose the way to handle it is to treat any root-level field on the JSON that doesn't have a matching property in the TypeScript class/interface as an extension and stuff it into the "extensions" property on the TypeScript class.
Is JsonExtensionData code generation not supported in typescript?