public static void AddExampleToParameter(this BodyParameter parameter, ISchemaRegistry schemaRegistry, string operationId, object example, bool allowMultipleExamples = false, JsonSerializerSettings customJsonSerializerSettings = null) { if (example != null) { parameter.Schema = schemaRegistry.AddExampleToSchemaDefinitions(operationId, example, allowMultipleExamples: allowMultipleExamples, customJsonSerializerSettings: customJsonSerializerSettings); } }
public static void AddOrUpdate(this IDictionary <string, Response> responseDictionary, ISchemaRegistry schemaRegistry, string operationId, string statusCode, Response response, object example = null, bool allowMultipleExamples = false, JsonSerializerSettings customJsonSerializerSettings = null) { if (responseDictionary.ContainsKey(statusCode)) { responseDictionary[statusCode] = response; } else { responseDictionary.Add(statusCode, response); } if (example != null) { responseDictionary[statusCode].Schema = schemaRegistry.AddExampleToSchemaDefinitions(operationId, example, statusCode, allowMultipleExamples, customJsonSerializerSettings); } }