You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Sending proprietary data types which have custom serialization attached to them is bothersome as we have to manually override the generated api contracts.
{
"type": "string",
"format": "date-time"
}
This will be mapped to DateTimeOffset for example.
Currently it's easy to override the "format" on the server side. But it's impossible to override the client generation to make use of the newly acquired information.
Describe the solution you'd like
{
"type": "string",
"format": "my-date-time"
}
Having a way to override string:my-date-time (imaginary syntax) generated output.
kind of like "dateType": "System.DateOnly" but for anything we need.
in Theory this should be doable by overriding how CSharpClientGeneratorSettings.CodeGeneratorSettings.TypeNameGenerator generates the type name
Describe alternatives you've considered
overriding the format to make the api return an object with a property of type "object", which then allows use to use "anyObjectType": "System.Text.Json.JsonElement" to manually deserialize the type.
But this requires us to copy the used JsonSerializationOptions everywhere.
Additional context ...
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Sending proprietary data types which have custom serialization attached to them is bothersome as we have to manually override the generated api contracts.
This will be mapped to
DateTimeOffset
for example.Currently it's easy to override the "format" on the server side. But it's impossible to override the client generation to make use of the newly acquired information.
Describe the solution you'd like
Having a way to override
string:my-date-time
(imaginary syntax) generated output.kind of like "dateType": "System.DateOnly" but for anything we need.
in Theory this should be doable by overriding how
CSharpClientGeneratorSettings.CodeGeneratorSettings.TypeNameGenerator
generates the type nameDescribe alternatives you've considered
overriding the format to make the api return an object with a property of type "object", which then allows use to use "anyObjectType": "System.Text.Json.JsonElement" to manually deserialize the type.
But this requires us to copy the used JsonSerializationOptions everywhere.
Additional context
...The text was updated successfully, but these errors were encountered: