An Introduction to Corvus.JsonSchema Code Generator for .NET
Matthew Adams takes you through a high level tour of Corvus.JsonSchema, an open-source, high-performance JSON schema validation and serialization library.
The library generates C# code from JSON schema files, allowing for improved interaction and performance over traditional deserialization methods. The video demonstrates how to set up a .NET project, create JSON schema files, and utilize Corvus.JsonSchema's features like the newly added source generator, which eliminates the need for command-line tools by integrating code generation directly into the project. It also covers adding necessary NuGet packages and setting build actions for files. Practical examples include creating and validating a simple 'TestPerson' JSON schema file. The video concludes with a demonstration of generating structured data types based on schema constraints and highlights the benefits of a schema-first approach to code generation.
Published on:
Learn moreRelated posts
How to Implement Generation in RAG
Understand the generation step of RAG: how LLMs use augmented context to produce grounded responses, how to enforce structured outputs with Py...
How to Implement Augmentation in RAG
Understand the augmentation step of RAG: how retrieved documents are structured into prompts, how metadata and citations improve response qual...
How to Implement Retrieval in RAG
Understand the retrieval step of RAG: Learn how database queries, keyword search, vector search, and hybrid approaches find the right informat...
TypeDeclaration: An Abstraction for Understanding JSON Schema
The Corvus.Json.CodeGeneration library analyses JSON Schema and builds a TypeDeclaration tree that maps schema patterns to code patterns. The ...
Optimising DAX: Practical Examples
The final post in the Optimising DAX series: the CALCULATE trap, variables and IF.EAGER, slicer costs, and a practical approach to isolating s...
Optimising DAX: Data Materialisation
Data materialisation is when the storage engine gives up on efficient processing and rebuilds the entire table. This post explains what trigge...
Building API Reference Documentation From Code, Part 2: Under the Hood
A deep dive into the cross-assembly linking, PDB-based source links, TFM scanning, enrichment merging, and search indexing that power our API ...
Building API Reference Documentation From Code, Part 1: The Pipeline
We generate about 8,800 API reference pages from 16 libraries across two engine versions, with source links, TFM availability badges, and hand...
Writing Effective Copilot Instructions for Complex Codebases
A flat copilot-instructions.md works for small projects. When your codebase hits 500k lines, 19 projects, and multiple code generators, you ne...
Optimising DAX: The Formula Engine and Storage Engine
When you execute a DAX query, two engines divide up the work. Understanding the split between the formula engine and the storage engine is key...