Skip to content

Set up v15 integration branch#5370

Merged
RicoSuter merged 5 commits intov15from
docs/v15-setup
Apr 21, 2026
Merged

Set up v15 integration branch#5370
RicoSuter merged 5 commits intov15from
docs/v15-setup

Conversation

@RicoSuter
Copy link
Copy Markdown
Owner

Summary

Starter PR for the NSwag v15 major release. Establishes plan + changelog docs and makes CI actually run against v15, including the temporary sibling NJsonSchema v12 checkout needed while UseLocalNJsonSchemaProjects=true is the default.

  • docs/plan_v15.md — v15 scope (STJ migration Migrate NSwag core to System.Text.Json (v15) - [WIP] #5355, absorbing NJsonSchema v12 breaking changes, opportunistic cleanups), dependency on NJsonSchema v12 during development, CI setup, branch model (master = v14.x stable, v15 = integration), release plan (NJsonSchema v12 first, then NSwag v15), and pre-release cleanup checklist.
  • docs/changelog_v15.md — running list of landed changes and v14 → v15 migration guide with placeholder sections for planned work.
  • CI triggersv15 added to OnPullRequestBranches and OnPushBranches in build/Build.CI.GitHubActions.cs and the regenerated workflow YAMLs.
  • Sibling NJsonSchema checkout — hand-added step git clone --depth 1 --branch v12 https://github.com/RicoSuter/NJsonSchema.git ../NJsonSchema in both build.yml and pr.yml (all three OS jobs in each), so the UseLocalNJsonSchemaProjects=true project references resolve on CI.

The sibling-checkout step is a deliberate hand edit; running NUKE to regenerate the workflows would remove it. This is intentional — the step only makes sense while v15 builds against local NJsonSchema v12, and will be regenerated away when v15 switches to package references. See the Pre-release cleanup checklist in plan_v15.md.

Open PR #5355 is already retargeted to v15 and will start receiving CI once this merges.

Test plan

  • After merge: a push to v15 triggers build.yml; the clone step successfully fetches NJsonSchema v12; the build succeeds against local project references.
  • A PR against v15 triggers pr.yml with the same clone step.
  • NUKE regeneration (nuke --generate-configuration GitHubActions_build --host GitHubActions and the pr equivalent) updates the branch filter but removes the clone step, matching the documented expectation.

Companion

NJsonSchema starter PR #1924 sets up the corresponding v12 branch, plan doc (plan_v12.md), changelog (changelog_v12.md), and CI triggers on that side.

…ing NJsonSchema checkout

- Add docs/plan_v15.md describing the v15 scope, dependency on NJsonSchema v12,
  development workflow (UseLocalNJsonSchemaProjects=true), branch model, release
  plan, CI setup, and pre-release cleanup checklist
- Add docs/changelog_v15.md as the running landed-changes log and v14 → v15
  migration guide (starts empty with structural placeholders for planned PR #5355
  and NJsonSchema v12 cascaded changes)
- Add v15 to OnPullRequestBranches / OnPushBranches in build/Build.CI.GitHubActions.cs
  and the regenerated workflow YAMLs
- Hand-edit both workflow YAMLs to clone RicoSuter/NJsonSchema@v12 as a sibling
  directory before build, so project references in UseLocalNJsonSchemaProjects=true
  mode resolve on CI (the clone step will be reverted when NUKE regenerates
  the YAMLs at v15 → master merge time; see cleanup checklist in plan_v15.md)
Pulled from PR #5355 so the v15 integration branch can build against local
NJsonSchema v12 source immediately, validating the sibling-checkout CI setup
end-to-end rather than waiting for the STJ migration PR to land.

- Directory.Build.props: new UseLocalNJsonSchemaProjects property, default true on v15
- 8 csprojs get a pair of conditional ItemGroup blocks (ProjectReference when
  UseLocalNJsonSchemaProjects=true, PackageReference otherwise):
  NSwag.Core, NSwag.Core.Yaml, NSwag.CodeGeneration, NSwag.CodeGeneration.CSharp,
  NSwag.CodeGeneration.TypeScript, NSwag.Generation, NSwag.AspNet.WebApi,
  NSwag.CodeGeneration.Tests

Verified locally: NSwag.Core, NSwag.CodeGeneration.CSharp, and NSwag.Generation
all build clean with ProjectReference resolving to ../NJsonSchema/src/...

Pre-release cleanup updated in plan_v15.md and this change noted in changelog_v15.md.
- Project Overview: what NSwag is, its distribution channels, NJsonSchema dep
- Cross-check with NJsonSchema: direction of change, when NSwag work needs
  NJsonSchema awareness (extension/overrides, API limitations, spec keyword
  parity, dependency bumping during v15)
- Supported spec targets: Swagger 2.0 / OpenAPI 3.0.x / OpenAPI 3.1, with a
  note that master is 3.0-oriented and v15 completes 3.1 support
- Build and test, high-level architecture by project layer, v15 branch
  conventions, repo-wide settings (TreatWarningsAsErrors, strong-naming,
  artifacts output, ImplicitUsings/LangVersion)
- Code style conventions (analyzer policy, no abbreviations, CRLF, AAA tests)
- Git rule: no AI attribution in commits / PRs / comments
CI was failing with MSB3030 during NSwag.ConsoleCore publish:
  "Could not copy the file .../NJsonSchema/artifacts/bin/.../release_net8.0/
   NJsonSchema.dll because it was not found."

Root cause: with UseArtifactsOutput=true on both repos, MSBuild's
Configuration=Release property does not reliably propagate across the repo
boundary when NSwag builds NJsonSchema project references transitively.
NJsonSchema ends up compiled to artifacts/bin/*/debug_* while NSwag expects
release_* for the --no-build publish step, so publish fails.

Fix: add an explicit pre-build step after the sibling NJsonSchema clone that
runs 'dotnet build NJsonSchema.sln -c Release' in ../NJsonSchema. The Release
artifacts are then present when NSwag's build invokes dotnet publish --no-build.

Doc updated in plan_v15.md with the rationale.
@RicoSuter RicoSuter merged commit ac46a90 into v15 Apr 21, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant