Skip to content

Instantly share code, notes, and snippets.

@trnktms
Last active September 27, 2023 09:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trnktms/210046c45dbdc0ff84111234498520a7 to your computer and use it in GitHub Desktop.
Save trnktms/210046c45dbdc0ff84111234498520a7 to your computer and use it in GitHub Desktop.
public class Startup
{
...
public void ConfigureServices(IServiceCollection services)
{
...
services.AddControllers().AddJsonOptions(Constants.JsonOptionsNames.DeliveryApi, options =>
{
// To resolve System.Text.Json polymorphic type resolving issue for the query controller
options.JsonSerializerOptions.TypeInfoResolver = new FallbackDeliveryApiJsonTypeResolver();
});
// Overwrite the default ApiContentResponseBuilder to add "system" section
services.AddSingleton<IApiContentResponseBuilder, ExtendedApiContentResponseBuilder>();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment