Commit 9ec2e93
fix(enum): strip FlagsArray from project defaults for non-[Flags] enums (#344)
* fix(enum): strip FlagsArray from project defaults for non-[Flags] enums
When FlagsArray is set via project-level AVI_EJC_DefaultEnumSerializationStrategy,
it should only apply to enums with [Flags] attribute. Non-flags enums now silently
get FlagsArray stripped from their strategies instead of generating a warning.
The AVI_EJC_0003 warning is now only emitted when FlagsArray is explicitly set
per-enum via [EnumJsonConverter] on a non-[Flags] enum.
Add ProjectConfigurationWorks_FlagsArray snapshot test verifying both behaviors.
Co-Authored-By: Claude <noreply@anthropic.com>
* Drop framework specific snapshots
* fix(enum): fall back to FirstEnumName when FlagsArray-only default is stripped
When AVI_EJC_DefaultEnumSerializationStrategy is configured as just 'FlagsArray'
(without FirstEnumName or BackingType), stripping FlagsArray for non-[Flags] enums
left serializationStrategies empty, producing broken 'SerializationStrategy => ;'
in the generated converter.
Now falls back to FirstEnumName when stripping leaves no strategies.
Add ProjectConfigurationWorks_FlagsArrayOnly snapshot test covering this edge case.
Co-Authored-By: Claude <noreply@anthropic.com>
* Drop framework specific snapshots
* Minor typo
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 665e63d commit 9ec2e93
File tree
134 files changed
+146
-16472
lines changed- src
- Aviationexam.GeneratedJsonConverters.SourceGenerator.Tests
- Aviationexam.GeneratedJsonConverters.SourceGenerator/Generators
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
134 files changed
+146
-16472
lines changedLines changed: 0 additions & 396 deletions
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
0 commit comments