/// <summary>
        /// Configures swagger to use NodaTime types.
        /// Uses System.Text.Json for serialization aspects.
        /// </summary>
        /// <param name="config">SwaggerGenOptions.</param>
        /// <param name="jsonSerializerOptions">Optional serializer options.</param>
        /// /// <param name="shouldGenerateExamples">Optional if we should generate examples</param>
        /// <param name="configureSerializerOptions">Optional action to configure jsonSerializerOptions.</param>
        /// <param name="dateTimeZoneProvider">Optional DateTimeZoneProviders.</param>
        public static void ConfigureForNodaTimeWithSystemTextJson(
            this SwaggerGenOptions config,
            JsonSerializerOptions jsonSerializerOptions = null,
            bool shouldGenerateExamples = true,
            Action <JsonSerializerOptions> configureSerializerOptions = null,
            IDateTimeZoneProvider dateTimeZoneProvider = null)
        {
            jsonSerializerOptions = jsonSerializerOptions ?? new JsonSerializerOptions();
            configureSerializerOptions?.Invoke(jsonSerializerOptions);

            global::NodaTime.Serialization.SystemTextJson.Extensions.ConfigureForNodaTime(jsonSerializerOptions,
                                                                                          dateTimeZoneProvider ?? DateTimeZoneProviders.Tzdb);

            var nodaTimeSchemaSettings = jsonSerializerOptions.CreateNodaTimeSchemaSettingsForSystemTextJson(shouldGenerateExamples);

            config.ConfigureForNodaTime(nodaTimeSchemaSettings);
        }