public bool TryWriteValue(IOpenApiWriter writer, JSchema schema) { if (schema.IsFormattedString("date")) { var value = DateTime.UtcNow.ToString("yyyy-MM-dd"); writer.WriteValue(value); return(true); } else if (schema.IsFormattedString("date-time")) { var value = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ssZ"); writer.WriteValue(value); return(true); } else { return(false); } }
public bool TryWriteValue(IOpenApiWriter writer, JSchema schema) { if (!schema.IsFormattedString("base64")) { return(false); } writer.WriteValue(Base64); return(true); }
public bool TryWriteValue(IOpenApiWriter writer, JSchema schema) { if (!schema.IsFormattedString("guid")) { return(false); } var guid = Guid.NewGuid().ToString(); writer.WriteValue(guid); return(true); }