Help! My Codebase has 5 JSON Libraries - How Generic Programming Rescued Me
summary
Codebase actually runs with RapidJSON, CPPRESTSDK, PicoJSON, nlohmann and Boost JSON and that fragmentation forces a practical solution: template the JWT logic to accept a JSON Traits layer and implement checks with is_detected and decltype/declval plus overload resolution hacks. The implementation uses static assertions and SFINAE to verify function signatures, handles member vs free functions, resolves overloads, and lands a JWT-CPP header-only PR that supports multiple libraries at the cost of added template complexity and brutal error messages.
AI-written summary · about
chapters (6)
- 0:00Start
- 4:03What Does the Solution Look like
- 5:47Verifying Json Web Tokens
- 9:25Function Signatures as Types
- 10:20Creating Tokens
- 18:01Review
related talks
56mA Fast, Compliant JSON Pull Parser for Writing Robust Applications
36mCompile-time reflection, Serialization and ORM
55mBuilding an Extensible Type Serialization System Using Partial Template Specialization
58mBoost.Asio and Boost.Serialization, Part I
22mThe Great SwiftData Heist
43mEmbracing the Web with JSON and PLV8
35mBeyond JSON: Improving inter-app communication
40mRapid Data Modeling Using ActiveRecord and the JSON Data Type
