-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
code generation for TypeScript about JsonExtensionData #1541
Comments
You're talking about this property in C#? |
in typescript. |
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? |
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
So for example, given this constructed 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?
The text was updated successfully, but these errors were encountered: