This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| From 3000ms to 300ms | |
| From Analytics to Action | |
| From Audience to Authority | |
| From Basics to Beyond | |
| From Chaos to Compliance | |
| From Chaos to Consistency | |
| From Chatbot to Coworker | |
| From Code to Compass | |
| From Copilot to Co-Engineer | |
| From Developer to DevRel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace FluentLogs; | |
| public static class Check | |
| { | |
| public static InMemoryLoggerChainAssert<T> That<T>(InMemoryLogger<T> logger) | |
| { | |
| return new InMemoryLoggerChainAssert<T>(logger); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class CustomerBlobJsonConverter : JsonConverter<CustomerDto20260303> | |
| { | |
| public override CustomerDto20260303 Read( | |
| ref Utf8JsonReader reader, | |
| Type typeToConvert, | |
| JsonSerializerOptions options) | |
| { | |
| var root = JsonSerializer.Deserialize<JsonElement>(ref reader); | |
| var schema = root.GetProperty("$schema").GetString(); | |
| return schema switch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "$schema": "https://json-schema.org/draft/2020-12/schema", | |
| "$id": "/hellish-enterprise/customer-schema-20260101.json", | |
| "title": "Customer", | |
| "description": "Validation schema for customers.", | |
| "type": "object", | |
| "required": ["userId", "email", "birthDate"], | |
| "properties": { | |
| "userId": { | |
| "type": "string", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "$schema": "https://json-schema.org/draft/2020-12/schema", | |
| "$id": "/hellish-enterprise/customer-schema-20260202.json", | |
| "title": "Customer", | |
| "description": "Validation schema for customers.", | |
| "type": "object", | |
| "required": ["userId", "email", "birthDate", "displayName"], | |
| "properties": { | |
| "userId": { | |
| "type": "string", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "$schema": "https://json-schema.org/draft/2020-12/schema", | |
| "$id": "/hellish-enterprise/customer-schema-20260303.json", | |
| "title": "Customer", | |
| "description": "Validation schema for customers.", | |
| "type": "object", | |
| "required": ["userName", "email", "birthDate", "displayName", "items"], | |
| "properties": { | |
| "userName": { | |
| "type": "string", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void Main() | |
| { | |
| var john1 = new CustomerDto20260101 | |
| { | |
| UserId = "john-1", | |
| Email = "john.fst@foomail.com", | |
| BirthDate = new DateTime(2001, 01, 01), | |
| }; | |
| var john2 = new CustomerDto20260202 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public string Serialize(Customer customer, string schemaName, JsonSchema schema) | |
| { | |
| var jsonDoc = JsonSerializer.SerializeToDocument(customer, GetSerializerOptions()); | |
| var evaluation = schema.Evaluate(jsonDoc.RootElement, GetEvaluationOptions()); | |
| var assembly = Assembly.GetAssembly(typeof(JsonSchema)); | |
| var fileVersion = | |
| assembly | |
| .GetCustomAttribute<AssemblyFileVersionAttribute>()? | |
| .Version; | |
| var validatorName = $"{assembly.GetName().Name}-{fileVersion}"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "Pellegriff", | |
| "age": 1, | |
| "miceCaught": 0, | |
| "espressosSpilled": 2, | |
| "$schema": "/cat/schema-20260310.json", | |
| "$validation": { | |
| "tool": "JsonSchema.Net-9.1.3", | |
| "timestamp": "2026-03-17T07:52:34.837129Z", | |
| "result": true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let toValidatedJson (schemaText: string) (schemaName: string) (o: obj) = | |
| let jsonDoc = JsonSerializer.SerializeToDocument(o, serializerOptions) | |
| let schema = JsonSchema.FromText(schemaText) | |
| let evalOptions = EvaluationOptions() | |
| evalOptions.OutputFormat <- OutputFormat.Flag | |
| evalOptions.RequireFormatValidation <- true | |
| let results = schema.Evaluate(jsonDoc.RootElement, evalOptions) | |
| if results.IsValid then | |
| let jsonObj = JsonObject.Create(jsonDoc.RootElement) |
NewerOlder