Popcorn

Partial-response JSON for ASP.NET Core: API clients ask for exactly the fields they need. v8 is a Roslyn source generator for System.Text.Json and Native AOT.

This project is maintained by Skyward App Company

Contents
Latest Post

Popcorn > Documentation > DotNet

Table Of Contents

Popcorn’s .NET provider ships as two NuGet packages:

  • Skyward.Api.Popcorn.SourceGen.Shared — runtime attributes ([Default] / [Always] / [Never] / [SubPropertyDefault]), envelopes (ApiResponse<T>, Pop<T>, ApiError), DI helpers, exception middleware.
  • Skyward.Api.Popcorn.SourceGen — Roslyn source generator (analyzer-only, no runtime DLL).

Both target .NET 8+ and are compatible with PublishAot=True and PublishTrimmed=True. Current version: 8.0.0-preview.1 (see Releases).

Building requires .NET SDK 9.0.100 or later (Roslyn 4.12); .NET 10 SDK recommended. Older SDKs skip the generator with warning CS9057. See the Quick Start for details.

Coming from v7? The v7 packages (Skyward.Api.Popcorn and Skyward.Api.Popcorn.DotNetCore) are the runtime-reflection line — still on NuGet, still maintained, but cannot AOT-publish. See Migrating from v7 to v8 for the upgrade path.

Tutorials (v8)

v7-only tutorials (reflection line)

Tutorials for v7 features that do not exist in v8 — each carries a deprecation banner pointing at the v8 replacement. Listed for v7 users still on the runtime-reflection line:

  • Authorizers → ASP.NET Core authorization middleware in v8.
  • Sorting → endpoint-layer sort in v8.
  • Inspectors → [PopcornEnvelope] + UsePopcornExceptionHandler in v8.
  • Contexts → ASP.NET Core DI in v8.
  • Expand From → [Never] / hand factory / Mapster in v8.
  • Blind Expansion → automatic in v8 for own types; JsonConverter<T> for external types.

Example projects