2 个仓库
Handles unknown enum constants by providing default values or nulls during deserialization.
Distinct from Enum Definitions: Distinct from Enum Definitions: focuses on the error-handling strategy for unknown values rather than the type definition itself.
Explore 2 awesome GitHub repositories matching data & databases · Enum Fallback Management. Refine with filters or upvote what's useful.
Moshi is a JSON serialization library and parser for Kotlin and Java. It functions as a reflectionless JSON encoder that converts typed objects to JSON strings and parses JSON data back into language objects. The library distinguishes itself through compile-time adapter generation, which removes the performance overhead associated with runtime reflection. It also provides a polymorphic JSON mapper that uses type identifiers to resolve and instantiate specific subclasses of a common base type. The framework supports custom adapter definitions for specialized type conversion, including nullabi
Allows specifying a default value or null to use when the input contains an unknown enum constant.
Mapperly 是一个 C# 源生成器,用于 .NET 中的高性能对象到对象映射。它作为一个编译时映射库,在构建过程中生成必要的转换代码,消除了在领域模型和数据传输对象(DTO)之间转换时对运行时反射的需求。 该工具的特色在于提供类型安全的诊断验证和严格的映射强制执行,在编译时为未映射的属性发出警告。它包含用于处理循环引用和深拷贝的专门能力,以保持对象标识并在复杂转换期间防止无限循环。 该项目涵盖了广泛的转换任务,包括嵌套对象层级的扁平化、各种集合类型和 Span 的转换,以及字符串与原始类型之间的全面枚举映射。它还通过查询投影支持数据库集成,将映射定义转换为表达式树,以优化从可查询源中检索字段。 配置选项允许自定义对象工厂、成员级排除以及用户定义映射逻辑的集成。生成的源代码可导出到可配置目录,以便进行人工检查和版本控制。
Provides fallback mechanisms to handle unknown enum values by redirecting them to specified defaults.