feat: Core IR extraction, OpenAPI support, and package restructuring#26
Merged
panesofglass merged 9 commits intomasterfrom Feb 7, 2026
Merged
feat: Core IR extraction, OpenAPI support, and package restructuring#26panesofglass merged 9 commits intomasterfrom
panesofglass merged 9 commits intomasterfrom
Conversation
…ture Design specification for refactoring FSharp.Data.JsonSchema into a three-package architecture (Core IR, NJsonSchema translator, OpenApi target). Includes project constitution, feature spec with 25 functional requirements across 5 user stories, implementation plan, data model, API contracts, research decisions, quickstart guide, and 48 tasks. Constitution v1.1.0 amended to support multi-package dependency rules. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…n fixes This commit completes the core extraction refactoring (feature 001-core-extraction), splitting the library into three packages while maintaining full backwards compatibility and adding critical regression fixes for format-annotated types. ## New Packages - **FSharp.Data.JsonSchema.Core 1.0.0**: Target-agnostic SchemaNode IR and type analyzer - Only depends on FSharp.Core + FSharp.SystemTextJson (no NJsonSchema) - Targets netstandard2.0 through net10.0 - 35 tests covering IR generation for all F# type categories - **FSharp.Data.JsonSchema 3.0.0**: Refactored to use Core IR + NJsonSchema translator - All 89 existing snapshot tests pass byte-identical - Internal implementation now: SchemaAnalyzer.analyze >> NJsonSchemaTranslator.translate - Public API unchanged (Generator.Create, Validation module, schema processors) - **FSharp.Data.JsonSchema.OpenApi 1.0.0**: ASP.NET Core OpenAPI integration - FSharpSchemaTransformer implements IOpenApiSchemaTransformer - Supports Microsoft.OpenApi 1.6.x (net9.0) and 2.0.x (net10.0) via conditional compilation - 17 tests covering translator and integration ## Regression Fixes Fixed 11 type regressions where SchemaAnalyzer would fall back to class reflection instead of matching NJsonSchema's format annotations: - DateTime/DateTimeOffset → string + "date-time" format - DateOnly → string + "date" format (NET6+) - TimeOnly → string + "time" format (NET6+) - Guid → string + "guid" format - Uri → string + "uri" format - TimeSpan → string + "duration" format - byte[] → string + "byte" format (base64, not array of integers) - Map<string,T>/Dictionary<string,T> → object + additionalProperties schema - Set<T> → array schema (via enhanced isArrayLike) Added 10 new snapshot tests for regression coverage. ## Infrastructure Updates - CI: Updated to test net8.0, net9.0, net10.0 and pack all 3 packages - README: Documented new package structure with usage examples - RELEASE_NOTES: Added version entries for all 3 packages ## Test Results All 151 tests pass across all target frameworks: - 99 main tests (89 existing + 10 new format tests) - 35 Core tests - 17 OpenApi tests Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…onSchema BREAKING CHANGE: Package has been renamed for clearer naming convention. Package Changes: - Renamed FSharp.Data.JsonSchema → FSharp.Data.JsonSchema.NJsonSchema - Created FSharp.Data.JsonSchema as deprecated compatibility shim - Aligned all package versions to 3.0.0 New Package Structure: 1. FSharp.Data.JsonSchema.Core (3.0.0) - Target-agnostic JSON Schema IR and type analyzer - No breaking API changes 2. FSharp.Data.JsonSchema.NJsonSchema (3.0.0) - New name for the main NJsonSchema-based package - Formerly FSharp.Data.JsonSchema - No API changes, same functionality 3. FSharp.Data.JsonSchema.OpenApi (3.0.0) - OpenAPI schema translator for ASP.NET Core - No breaking API changes 4. FSharp.Data.JsonSchema (3.0.0) [DEPRECATED] - Thin compatibility wrapper that references NJsonSchema package - Includes [<Obsolete>] attributes to guide migration - Will not receive updates beyond 3.0.0 Migration: Replace: <PackageReference Include="FSharp.Data.JsonSchema" Version="3.0.0" /> With: <PackageReference Include="FSharp.Data.JsonSchema.NJsonSchema" Version="3.0.0" /> Code remains unchanged - namespace and API are identical. Test Results: All 151 tests passing (Core: 35, OpenApi: 17, Main: 99) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Changed focus from "opinionated NJsonSchema wrapper" to "pluggable Core IR with multiple translation targets." - Updated main description to emphasize extensible architecture - Replaced "Why JSON Schema?" with "Why This Library?" - Highlights F#-first type analysis and pluggable translators - Positions NJsonSchema and OpenAPI as translation targets, not foundation Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Fixes "Could not find a test logger with AssemblyQualifiedName, URI or FriendlyName 'GitHubActions'" error in CI pipeline. The CI workflow uses --logger "GitHubActions;report-warnings=false" but Core.Tests and OpenApi.Tests were missing the package reference. Added GitHubActionsTestLogger v1.1.0 to: - test/FSharp.Data.JsonSchema.Core.Tests - test/FSharp.Data.JsonSchema.OpenApi.Tests (Main Tests already had this package) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…ility Fixes NETSDK1085 error: "The 'NoBuild' property was set to true but the 'Build' target was invoked." This is a known issue with .NET SDK 10.0.102 and multi-targeted projects. Removing --no-build from the pack command is the recommended workaround. Pack will still reuse existing build artifacts from the Build step, so this doesn't cause unnecessary rebuilds. See: dotnet/sdk#44199 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The projects target netcoreapp3.1 and net6.0 which require their respective SDKs to be installed. The CI was missing these, causing pack failures. SDKs now installed: - .NET Core 3.1 (for netcoreapp3.1) - .NET 6 (for net6.0) - .NET 8 (for net8.0, testing) - .NET 9 (for net9.0, testing) - .NET 10 (for net10.0, testing) netstandard2.0 and netstandard2.1 can be built with any modern SDK. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The .NET 10 SDK can build all target frameworks (netstandard2.0, netcoreapp3.1, net6.0, etc.) by downloading targeting packs automatically. Only need: - .NET 9 SDK for net9.0 tests - .NET 10 SDK for net10.0 tests and building all frameworks The original NETSDK1085 error was from the --no-build flag bug, not missing SDKs. Reverts unnecessary SDK additions from previous commit. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements a major architectural refactoring that splits the library into a three-package family with target-agnostic Core IR and OpenAPI support.
Package Structure (All at 3.0.0)
FSharp.Data.JsonSchema.Core - Target-agnostic JSON Schema IR and type analyzer
SchemaNodediscriminated union (11 variants)SchemaAnalyzer.analyzefor recursive F# type analysisFSharp.Data.JsonSchema.NJsonSchema - NJsonSchema-based implementation (renamed from FSharp.Data.JsonSchema)
SchemaAnalyzer.analyze >> NJsonSchemaTranslator.translateGenerator.Create,Validationmodule)FSharp.Data.JsonSchema.OpenApi - OpenAPI translator for ASP.NET Core
FSharpSchemaTransformerimplementsIOpenApiSchemaTransformerFSharp.Data.JsonSchema [DEPRECATED] - Compatibility shim
[<Obsolete>]attributes to guide migrationKey Changes
Core IR Pipeline:
SchemaNodeas intermediate representationSchemaAnalyzerhandles F# type reflection and analysisRegression Fixes:
Fixed 11 types that previously worked in NJsonSchema but would fall back to class reflection in Core:
date-timeformatdate/timeformatsguidformaturiformatdurationformatbyteformat (base64)Package Renaming:
FSharp.Data.JsonSchema→FSharp.Data.JsonSchema.NJsonSchema(go-forward name)Test Results
✅ All 151 tests passing
All existing snapshots remain byte-identical, ensuring zero behavioral regressions.
Migration Guide
For existing users of FSharp.Data.JsonSchema:
Replace:
With:
Code remains unchanged - namespace and API are identical. The deprecated package will continue to work but includes compiler warnings guiding migration.
Breaking Changes
BREAKING CHANGE: Package renamed for clearer naming convention. Functionality and API remain identical, but package name has changed.
Test Plan
🤖 Generated with Claude Code