diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index f518144..b2fd4c5 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -3,7 +3,7 @@ name: CI
on:
push:
tags:
- - v[0-9]+.[0-9]+.[0-9]+
+ - v[0-9]+.[0-9]+.[0-9]+*
branches:
- master
pull_request:
@@ -16,30 +16,54 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- - name: Use dotnet CLI
+
+ - name: Use dotnet CLI 6
+ uses: actions/setup-dotnet@v1
+ with:
+ dotnet-version: "6.0.x" # SDK Version to use.
+
+ - name: Use dotnet CLI 8
uses: actions/setup-dotnet@v1
with:
- dotnet-version: "5.0.x" # SDK Version to use.
+ dotnet-version: "8.0.x" # SDK Version to use.
+
+ - name: Set env
+ if: startsWith( github.ref, 'refs/tags/v' )
+ run: |
+ RELEASE_VERSION="${GITHUB_REF#refs/*/}"
+ echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_ENV
+ echo "Version=${RELEASE_VERSION:1}" >> $GITHUB_ENV
+
- name: Build
run: |
dotnet restore
dotnet build -c Release --no-restore
- - name: Test
- run: dotnet test -c Release --no-restore --no-build --framework net5.0 --logger "GitHubActions;report-warnings=false"
+
+ - name: Test net6.0
+ run: dotnet test -c Release --no-restore --no-build --framework net6.0 --logger "GitHubActions;report-warnings=false"
+
+ - name: Test net8.0
+ run: dotnet test -c Release --no-restore --no-build --framework net8.0 --logger "GitHubActions;report-warnings=false"
+
- name: Pack
run: dotnet pack -c Release --no-restore --no-build --include-symbols -o out
+
+ - name: Upload Test Results
+ if: failure()
+ uses: actions/upload-artifact@v4
+ with:
+ name: verify-test-results
+ path: |
+ **/*.received.*
- name: Upload artifact
- uses: actions/upload-artifact@v1
+ uses: actions/upload-artifact@v4
with:
name: nupkg
path: ./out
- - name: Set env
- if: startsWith( github.ref, 'refs/tags/v' )
- run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Push
if: startsWith( github.ref, 'refs/tags/v' )
env:
API_KEY: ${{ secrets.NUGET_API_KEY }}
SOURCE: "https://api.nuget.org/v3/index.json"
run: |
- dotnet nuget push ./out/FSharp.Data.JsonSchema.${RELEASE_VERSION:1}.nupkg --skip-duplicate --no-symbols true --source $SOURCE --api-key $API_KEY
+ dotnet nuget push ./out/*FSharp.Data.JsonSchema.${RELEASE_VERSION:1}.nupkg --skip-duplicate --no-symbols --source $SOURCE --api-key $API_KEY
diff --git a/.gitignore b/.gitignore
index b04b17e..ee6680e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,9 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
+# Verify Tests received files
+*.received.*
+
# User-specific files
*.suo
*.user
diff --git a/build.ps1 b/build.ps1
index 0d38c28..e9a7e60 100644
--- a/build.ps1
+++ b/build.ps1
@@ -1,4 +1,4 @@
dotnet restore
dotnet build -c Release --no-restore
-dotnet test -c Release --no-restore --no-build --framework net5.0
+dotnet test -c Release --no-restore --no-build --framework net8.0
dotnet pack -c Release -o bin --no-restore --no-build
diff --git a/build.sh b/build.sh
index b816886..de6a861 100755
--- a/build.sh
+++ b/build.sh
@@ -1,5 +1,8 @@
#!/usr/bin/env bash
+
+set -euo pipefail
+
dotnet restore
dotnet build -c Release --no-restore
-dotnet test -c Release --no-restore --no-build --framework net5.0
+dotnet test -c Release --no-restore --no-build --framework net8.0
dotnet pack -c Release -o bin --no-restore --no-build
diff --git a/src/Directory.Build.props b/src/Directory.Build.props
index bd8786a..2eb047f 100644
--- a/src/Directory.Build.props
+++ b/src/Directory.Build.props
@@ -1,6 +1,7 @@
- 2.0.2
+ 2.1.2
+ $(Version)
Ryan Riley
Ryan Riley
https://github.com/panesofglass/FSharp.Data.JsonSchema
@@ -16,10 +17,10 @@
true
-
+
true
-
+
true
snupkg
diff --git a/src/FSharp.Data.JsonSchema/FSharp.Data.JsonSchema.fsproj b/src/FSharp.Data.JsonSchema/FSharp.Data.JsonSchema.fsproj
index f427b31..bb0cc8d 100644
--- a/src/FSharp.Data.JsonSchema/FSharp.Data.JsonSchema.fsproj
+++ b/src/FSharp.Data.JsonSchema/FSharp.Data.JsonSchema.fsproj
@@ -1,14 +1,16 @@
- netstandard2.0;netstandard2.1;netcoreapp3.1;net5.0
+ netstandard2.0;netstandard2.1;netcoreapp3.1;net6.0;net8.0
+ $(GITHUB_REPOSITORY_OWNER).FSharp.Data.JsonSchema
+ $(Version)
-
+
-
\ No newline at end of file
+
diff --git a/src/FSharp.Data.JsonSchema/JsonSchema.fs b/src/FSharp.Data.JsonSchema/JsonSchema.fs
index e38ab13..6268890 100644
--- a/src/FSharp.Data.JsonSchema/JsonSchema.fs
+++ b/src/FSharp.Data.JsonSchema/JsonSchema.fs
@@ -5,7 +5,6 @@ open System.Collections.Generic
open Microsoft.FSharp.Reflection
open Namotion.Reflection
open NJsonSchema
-open NJsonSchema.Annotations
open NJsonSchema.Generation
/// Microsoft.FSharp.Reflection helpers
@@ -23,31 +22,48 @@ module Reflection =
let isOption (y: System.Type) =
y.IsGenericType
- && typedefof<_ option> = y.GetGenericTypeDefinition()
-
+ &&
+ let def = y.GetGenericTypeDefinition()
+ def = typedefof<_ option> || def = typedefof>
+
+ let isObjOption (y: System.Type) =
+ y = typedefof<_ option> || y = typedefof>
+
let isPrimitive (ty: Type) =
ty.IsPrimitive || ty = typeof || ty = typeof
-type OptionSchemaProcessor() =
- static let optionTy = typedefof