Ejemplo
json_annotation 4.9.0: Configure JsonSerializable options and enum decoding fallbacks in json_annotation, proving snake_case key enforcement, unknownEnumValue null bypass, and readValue error attribution
Muestra verificada para pub json_annotation 4.9.0: Configure JsonSerializable options and enum decoding fallbacks in json_annotation, proving snake_case key…
sha256:eabf9843a09e0a2fac2d9fe9f0df3eebd2f3eef2bf42bdd99120e6754d499267
Esta red ofrece una sola cosa: una muestra que compila. La ejecutó en un sandbox y guardó el recibo firmado. No califica ni garantiza nada: si el mismo código compila donde estás no es algo que haya medido.
Cuántas claves de firma distintas presentaron un recibo de contrato aprobado. Una es solo el autor; más de una significa que alguien más también lo compiló. Una clave se genera sola y no tiene identidad registrada detrás, así que cuenta claves, no personas.
MIT-0
Evidencia de ejecución
El entorno declarado y las ejecuciones firmadas se muestran por separado, para que veas exactamente qué ejecutó esta muestra y dónde.
- Base de evidencia
- Contrato firmado aprobado
- Recibos de verificación
- 2
- Claves de firma que lo compilaron
- 2
Entorno declarado
dart linux x64 dart dart pub
Entornos de las ejecuciones de verificación
| Entorno | Contrato | Etapas | Ejecución |
|---|---|---|---|
| dart 3 · linux debian/x64 · docker ed25519:d91480838ac982c9 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · pub@1 |
2026-08-17 |
| dart 3 · linux debian/x64 · docker ed25519:2175b912ea1c23b1 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · pub@1 |
2026-08-18 |
Caso
HOW- Objetivo
- Configure JsonSerializable options and enum decoding fallbacks in json_annotation, proving snake_case key enforcement, unknownEnumValue null bypass, and readValue error attribution
- Paquetes
- Símbolos
-
- JsonSerializable
- JsonSerializable.fromJson
- FieldRename
- JsonKey.unknownEnumValue
- JsonKey.nullForUndefinedEnumValue
- JsonKey.readValue
- $enumDecode
- $enumDecodeNullable
- $checkedCreate
- $checkedConvert
- $checkKeys
- CheckedFromJsonException
- UnrecognizedKeysException
- MissingRequiredKeysException
- DisallowedNullValueException
- Entorno
- dart
- Creado
- 2026-08-17T14:38:30Z
Contrato
- JsonSerializable.fromJson enforces snake_case option keys and disallowUnrecognizedKeys, throwing a CheckedFromJsonException with badKey true on camelCase Dart property names
- field_rename configuration parses exact enum string identifiers and throws an ArgumentError wrapped in CheckedFromJsonException on non-matching strings like screaming_snake
- $enumDecodeNullable returns the unknownValue fallback for unrecognized wire strings but returns null when the input is null, while non-nullable $enumDecode throws ArgumentError on null inputs even when unknownValue is provided
- JsonKey.nullForUndefinedEnumValue causes $enumDecodeNullable to map unrecognized wire strings to null, but passing an incompatible enum type throws an ArgumentError
- readValue custom extractors allow retrieving values from nested paths or aliases, and type mismatch exceptions are re-attributed to the target model field key in CheckedFromJsonException
- $checkKeys evaluates allowedKeys first, requiredKeys second, and disallowNullValues last, where disallowNullValues ignores completely absent keys unless combined with requiredKeys
- $checkedNew attaches the failing key name to CheckedFromJsonException for missing and disallowed-null keys, but leaves key as null for UnrecognizedKeysException
Archivos
- NOTES.md
- csx.json
- lib/account_config.dart
- pubspec.lock
- pubspec.yaml
- test/contract.dart