Popcorn is a .Net Middleware for your RESTful API that allows your consumers to request exactly as much or as little as they need, with no effort from you.
This project is maintained by Skyward App Company
First public preview of v8 — Popcorn reimplemented as a Roslyn source generator for Native AOT and IL trimming compatibility. See MigrationV7toV8.md for the full migration story.
New packages (side-by-side installable with v7):
Skyward.Api.Popcorn.SourceGen — Roslyn analyzer, developmentDependency.Skyward.Api.Popcorn.SourceGen.Shared — runtime attributes, envelopes (ApiResponse<T> / Pop<T> / ApiError), exception middleware (UsePopcornExceptionHandler), DI helpers.Highlights:
PublishAot=True and PublishTrimmed=True. No runtime reflection on the hot path.System.Text.Json (0.87× time / 0.93× alloc). Full 3-way benchmark report under benchmarks/results/v2-baseline/.[PopcornEnvelope] + [PopcornPayload] / [PopcornError] / [PopcornSuccess] markers + UsePopcornExceptionHandler).[SubPropertyDefault("[Make,Model]")] attribute (v7’s [SubPropertyIncludeByDefault], renamed and generator-backed).Breaking changes from v7 (abridged — see MigrationV7toV8.md):
[IncludeByDefault] → [Default], [IncludeAlways] → [Always], [InternalOnly] → [Never], [SubPropertyIncludeByDefault] → [SubPropertyDefault].config.Map<T>(), .Translate<T>(...), .Authorize<T>(...), .SetContext(...), .SetInspector(...)) removed entirely. Type discovery moved to [JsonSerializable(typeof(ApiResponse<T>))] on a JsonSerializerContext. Exception wrapping moves to UsePopcornExceptionHandler() + a [PopcornEnvelope] type.?include=[...] now matches the wire name (from [JsonPropertyName] or JsonNamingPolicy), not the C# identifier. Client-visible contract.SetContext(dict), MapEntityFramework<S,P,Ctx>, BlindHandler, [Translator] lambdas. Each has a cleaner replacement documented in the migration guide.+ Project inception!