diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9444ca6d..405c3763 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,42 +17,50 @@ permissions: jobs: ci: runs-on: ubuntu-latest - steps: - - name: Checkout current branch - uses: actions/checkout@v3 - with: - submodules: 'true' - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - java-version: '17' - distribution: 'temurin' - check-latest: true - cache: 'sbt' - - name: Run tests - run: sbt lint test - env: - # see https://stackoverflow.com/questions/69394632/webpack-build-failing-with-err-ossl-evp-unsupported - NODE_OPTIONS: "--openssl-legacy-provider" - - publish: - runs-on: ubuntu-latest - needs: [ci] - if: github.event_name == 'release' steps: - name: Checkout current branch uses: actions/checkout@v3 + with: + submodules: 'true' - name: Set up JDK 17 uses: actions/setup-java@v3 with: java-version: '17' distribution: 'temurin' - check-latest: true - cache: 'sbt' - - name: Release - run: sbt ci-release + check-latest: true + - uses: bleep-build/bleep-setup-action@0.0.1 + - uses: coursier/cache-action@v6 + with: + extraFiles: bleep.yaml + + - name: Scalafmt Check + run: bleep fmt --check + + - name: Run tests env: - PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} - PGP_SECRET: ${{ secrets.PGP_SECRET }} - SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} - SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} \ No newline at end of file + CI: true + run: | + bleep compile + bleep test + + # publish: + # runs-on: ubuntu-latest + # needs: [ci] + # if: github.event_name == 'release' + # steps: + # - name: Checkout current branch + # uses: actions/checkout@v3 + # - name: Set up JDK 17 + # uses: actions/setup-java@v3 + # with: + # java-version: '17' + # distribution: 'temurin' + # check-latest: true + # cache: 'sbt' + # - name: Release + # run: sbt ci-release + # env: + # PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} + # PGP_SECRET: ${{ secrets.PGP_SECRET }} + # SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + # SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index bd2520f0..9c83bdfd 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ test-reports/ .bsp/ .metals/ metals.sbt +.bleep/ .idea .vscode \ No newline at end of file diff --git a/build.sbt b/bleep-moved-files-0/build.sbt similarity index 100% rename from build.sbt rename to bleep-moved-files-0/build.sbt diff --git a/project/build.properties b/bleep-moved-files-0/project/build.properties similarity index 100% rename from project/build.properties rename to bleep-moved-files-0/project/build.properties diff --git a/project/plugins.sbt b/bleep-moved-files-0/project/plugins.sbt similarity index 100% rename from project/plugins.sbt rename to bleep-moved-files-0/project/plugins.sbt diff --git a/bleep.yaml b/bleep.yaml new file mode 100644 index 00000000..f26faf80 --- /dev/null +++ b/bleep.yaml @@ -0,0 +1,145 @@ +$schema: https://raw.githubusercontent.com/oyvindberg/bleep/master/schema.json +$version: 0.0.2 +projects: + scripts: + dependencies: build.bleep::bleep-core:${BLEEP_VERSION} + platform: + name: jvm + scala: + version: 3.3.0 + typed-json: + dependsOn: + - typed-json-formats + - typed-json-macros + extends: + - template-common-main + - template-cross-all + typed-json-formats: + dependencies: io.github.cquiroz::scala-java-time:2.5.0 + dependsOn: typed-json-parser + extends: + - template-common-main + - template-cross-all + folder: ./formats + typed-json-formats-test: + cross: + js3: + dependencies: org.scala-js:scalajs-test-bridge_2.13:${PLATFORM_VERSION} + dependsOn: typed-json-formats + extends: + - template-common-test + - template-cross-all + folder: ./formats + typed-json-js-export: + dependsOn: typed-json + extends: + - template-common-main + - template-js + typed-json-macros: + dependencies: io.github.frawa::inline-files:0.1.2+43-09b6826f-SNAPSHOT + dependsOn: typed-json-parser-jawn + extends: + - template-common-main + - template-jvm + folder: ./macros + typed-json-macros-test: + dependsOn: typed-json-macros + extends: + - template-common-test + - template-jvm + folder: ./macros + typed-json-parser: + extends: + - template-common-main + - template-cross-all + folder: ./parser + typed-json-parser-jawn: + dependencies: org.typelevel::jawn-parser:1.5.0 + dependsOn: typed-json-parser + extends: + - template-common-main + - template-cross-all + folder: ./parser-jawn + typed-json-parser-jawn-test: + cross: + js3: + dependencies: org.scala-js:scalajs-test-bridge_2.13:${PLATFORM_VERSION} + dependsOn: typed-json-parser-jawn + extends: + - template-common-test + - template-cross-all + folder: ./parser-jawn + typed-json-parser-test: + cross: + js3: + dependencies: org.scala-js:scalajs-test-bridge_2.13:${PLATFORM_VERSION} + dependsOn: typed-json-parser + extends: + - template-common-test + - template-cross-all + folder: ./parser + typed-json-parser-zio: + dependencies: dev.zio::zio-json:0.5.0 + dependsOn: typed-json-parser + extends: + - template-common-main + - template-cross-all + folder: ./parser-zio + typed-json-parser-zio-test: + cross: + js3: + dependencies: org.scala-js:scalajs-test-bridge_2.13:${PLATFORM_VERSION} + dependsOn: typed-json-parser-zio + extends: + - template-common-test + - template-cross-all + folder: ./parser-zio + typed-json-test: + cross: + js3: + dependencies: org.scala-js:scalajs-test-bridge_2.13:${PLATFORM_VERSION} + dependsOn: typed-json + extends: + - template-common-test + - template-cross-all + folder: ./typed-json +resolvers: https://s01.oss.sonatype.org/content/repositories/releases +templates: + template-common: + java: + options: -J--add-exports -Jjdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED + -Jjdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED -Jjdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED + -Jjdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED -Jjdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED + -build-tool:sbt -sourceroot:${BUILD_DIR} -targetroot:${TARGET_DIR}/meta + scala: + options: -Xmigration -deprecation -feature -indent -new-syntax -unchecked + -Xmacro-settings:INLINE_HOME=${PROJECT_DIR}/.. + version: 3.3.0 + template-common-main: + extends: template-common + sbt-scope: main + template-common-test: + dependencies: org.scalameta::munit:1.0.0-M8 + extends: template-common + isTestProject: true + sbt-scope: test + testFrameworks: zio.test.sbt.ZTestFramework + template-cross-all: + cross: + js3: + extends: template-js + jvm3: + extends: template-jvm + source-layout: sbt-matrix + template-js: + platform: + jsEmitSourceMaps: false + jsJsdom: false + jsKind: none + jsMode: debug + jsNodeVersion: 18.4.0 + jsVersion: 1.13.1 + name: js + template-jvm: + platform: + name: jvm diff --git a/macros/src/main/scala/frawa/typedjson/macros/Macros.scala b/macros/src/main/scala/frawa/typedjson/macros/Macros.scala index 3e4fd8d7..2fb627c4 100644 --- a/macros/src/main/scala/frawa/typedjson/macros/Macros.scala +++ b/macros/src/main/scala/frawa/typedjson/macros/Macros.scala @@ -22,12 +22,26 @@ import frawa.inlinefiles.compiletime.FileContents import frawa.typedjson.parser.Value import JsonUtils.{given, *} +import scala.annotation.experimental +import java.nio.file.Path +import java.nio.file.Paths +@experimental object Macros: + import frawa.inlinefiles.InlineFilesWithHome.resolveHome - inline def inlineJsonContents(path: String, ext: String): Map[String, Value] = ${ - inlineJsonContents_impl('path, 'ext) + inline def inlineJsonContents(path: String, ext: String)(homeSetting: String): Map[String, Value] = ${ + inlineJsonContents_impl('path, 'ext, 'homeSetting) } - def inlineJsonContents_impl(path: Expr[String], ext: Expr[String])(using Quotes): Expr[Map[String, Value]] = - Expr(FileContents.parseTextContentsIn(path.valueOrAbort, ext.valueOrAbort, true)(parseJsonValue)) + def inlineJsonContents_impl(path: Expr[String], ext: Expr[String], homeSetting: Expr[String])(using + Quotes + ): Expr[Map[String, Value]] = + Expr( + FileContents.parseTextContentsIn( + path.valueOrAbort, + ext.valueOrAbort, + true, + Some(resolveHome(homeSetting.valueOrAbort)) + )(parseJsonValue) + ) diff --git a/typed-json/src/main/scala/frawa/typedjson/TypedJson.scala b/typed-json/src/main/scala/frawa/typedjson/TypedJson.scala index 9d010bf9..19a6b812 100644 --- a/typed-json/src/main/scala/frawa/typedjson/TypedJson.scala +++ b/typed-json/src/main/scala/frawa/typedjson/TypedJson.scala @@ -39,6 +39,7 @@ import frawa.typedjson.suggest.Suggest import frawa.typedjson.output.OutputOps import frawa.typedjson.suggest.SuggestOutput import frawa.typedjson.keywords.KeywordLocation +import scala.annotation.experimental case class TypedJson(private val state: Option[(Keywords, CacheState)]): import TypedJson.* @@ -97,6 +98,7 @@ object TypedJson: def create(): TypedJson = new TypedJson(None) + @experimental def create( schemaJson: String )(using parser: Parser): Either[InputError, TypedJson] = @@ -107,18 +109,22 @@ object TypedJson: .swap .flatMap(create(_)) + @experimental def create(schema: Value): Either[InputError, TypedJson] = createWithSchema(SchemaValue.root(schema)) + @experimental def create(schema: Offset.Value): Either[InputError, TypedJson] = createWithSchema(SchemaValue.root(Offset.withoutOffset(schema))) + @experimental def createWithMetaSchemas(): TypedJson = val lazyResolver = MetaSchemas.lazyResolver val base = MetaSchemas.draft202012 val Some(schema) = lazyResolver(base.resolve("schema")): @unchecked createWithSchema(schema).getOrElse(throw new IllegalStateException("broken meta schemas")) + @experimental def createWithSchema(schema: SchemaValue): Either[InputError, TypedJson] = val lazyResolver = MetaSchemas.lazyResolver val vocabulary = Vocabulary.specDialect() diff --git a/typed-json/src/main/scala/frawa/typedjson/meta/MetaSchemas.scala b/typed-json/src/main/scala/frawa/typedjson/meta/MetaSchemas.scala index c4a0b772..091663dd 100644 --- a/typed-json/src/main/scala/frawa/typedjson/meta/MetaSchemas.scala +++ b/typed-json/src/main/scala/frawa/typedjson/meta/MetaSchemas.scala @@ -21,19 +21,23 @@ import frawa.typedjson.macros.Macros import frawa.typedjson.util.UriUtil.uri import java.net.URI +import scala.annotation.experimental object MetaSchemas: val draft202012: URI = uri("https://json-schema.org/draft/2020-12/") + @experimental def lazyResolver: LoadedSchemasResolver.LazyResolver = { uri => if uri.getSchemeSpecificPart.startsWith(draft202012.getSchemeSpecificPart) then resolve202012(draft202012.relativize(uri)) else None } + @experimental private def resolve202012(relative: URI): Option[RootSchemaValue] = val name = relative.getSchemeSpecificPart metaSchemas.get(name + ".json").map(SchemaValue.root(_)) - private val metaSchemas = Macros.inlineJsonContents("./metaSchemas", ".json") + @experimental + private val metaSchemas = Macros.inlineJsonContents("./metaSchemas", ".json")("INLINE_HOME") diff --git a/typed-json/src/test/scala/frawa/typedjson/eval/EvalResolveTest.scala b/typed-json/src/test/scala/frawa/typedjson/eval/EvalResolveTest.scala index e1fca030..f0f071ac 100644 --- a/typed-json/src/test/scala/frawa/typedjson/eval/EvalResolveTest.scala +++ b/typed-json/src/test/scala/frawa/typedjson/eval/EvalResolveTest.scala @@ -31,7 +31,9 @@ import frawa.typedjson.eval.CacheState import frawa.typedjson.output.SimpleOutput import frawa.typedjson.output.SimpleOutput.given import frawa.typedjson.util.WithPointer +import scala.annotation.experimental +@experimental class EvalResolveTest extends FunSuite: import Util.* @@ -143,6 +145,7 @@ class EvalResolveTest extends FunSuite: } test("$ref to validation spec, with two '$ref's") { + @experimental val lazyResolver = Some(MetaSchemas.lazyResolver) withCompiledSchema(refToValidationSpec, lazyResolver) { fun => assertEquals( diff --git a/typed-json/src/test/scala/frawa/typedjson/eval/EvalSpecDetailsTest.scala b/typed-json/src/test/scala/frawa/typedjson/eval/EvalSpecDetailsTest.scala index 24d2d98e..4efdd3d9 100644 --- a/typed-json/src/test/scala/frawa/typedjson/eval/EvalSpecDetailsTest.scala +++ b/typed-json/src/test/scala/frawa/typedjson/eval/EvalSpecDetailsTest.scala @@ -35,7 +35,9 @@ import java.net.URI import frawa.typedjson.meta.MetaSchemas import frawa.typedjson.jsonSchemaTestSuite.Remotes import frawa.typedjson.keywords.Ignored +import scala.annotation.experimental +@experimental class EvalSpecDetailsTest extends FunSuite: import Util.* @@ -382,6 +384,7 @@ class EvalSpecDetailsTest extends FunSuite: } test("Location-independent identifier in remote ref") { + @experimental val lazyResolver = (uri: URI) => MetaSchemas.lazyResolver(uri).orElse(Remotes.lazyResolver(uri)) withCompiledSchema( """|{ diff --git a/typed-json/src/test/scala/frawa/typedjson/jsonSchemaTestSuite/Draft202012OptionalFormatTest.scala b/typed-json/src/test/scala/frawa/typedjson/jsonSchemaTestSuite/Draft202012OptionalFormatTest.scala index 734c1753..686a801b 100644 --- a/typed-json/src/test/scala/frawa/typedjson/jsonSchemaTestSuite/Draft202012OptionalFormatTest.scala +++ b/typed-json/src/test/scala/frawa/typedjson/jsonSchemaTestSuite/Draft202012OptionalFormatTest.scala @@ -16,11 +16,12 @@ package frawa.typedjson.jsonSchemaTestSuite -import frawa.inlinefiles.InlineFiles.* -import frawa.typedjson.parser.* import frawa.typedjson.testutil.TestUtil.{*, given} +import scala.annotation.experimental +@experimental class Draft202012OptionalFormatTest extends JsonSchemaTestSuite: + import frawa.inlinefiles.InlineFilesWithHome.* private val draft202012OptionalFormatFiles = draft202012.folder("optional/format").files() diff --git a/typed-json/src/test/scala/frawa/typedjson/jsonSchemaTestSuite/Draft202012OptionalTest.scala b/typed-json/src/test/scala/frawa/typedjson/jsonSchemaTestSuite/Draft202012OptionalTest.scala index 7b8824c7..d22f24a1 100644 --- a/typed-json/src/test/scala/frawa/typedjson/jsonSchemaTestSuite/Draft202012OptionalTest.scala +++ b/typed-json/src/test/scala/frawa/typedjson/jsonSchemaTestSuite/Draft202012OptionalTest.scala @@ -16,11 +16,13 @@ package frawa.typedjson.jsonSchemaTestSuite -import frawa.inlinefiles.InlineFiles.* -import frawa.typedjson.macros.Macros import frawa.typedjson.testutil.TestUtil.{*, given} +import scala.annotation.experimental +@experimental class Draft202012OptionalTest extends JsonSchemaTestSuite: + import frawa.inlinefiles.InlineFilesWithHome.* + private val draft202012OptionalFiles = draft202012.folder("optional").files() // override protected val onlyDescription: Option[String] = diff --git a/typed-json/src/test/scala/frawa/typedjson/jsonSchemaTestSuite/Draft202012Test.scala b/typed-json/src/test/scala/frawa/typedjson/jsonSchemaTestSuite/Draft202012Test.scala index 1b9a2832..5725790e 100644 --- a/typed-json/src/test/scala/frawa/typedjson/jsonSchemaTestSuite/Draft202012Test.scala +++ b/typed-json/src/test/scala/frawa/typedjson/jsonSchemaTestSuite/Draft202012Test.scala @@ -16,11 +16,13 @@ package frawa.typedjson.jsonSchemaTestSuite -import frawa.inlinefiles.InlineFiles.* -import frawa.typedjson.macros.Macros import frawa.typedjson.testutil.TestUtil.{*, given} +import scala.annotation.experimental +@experimental class Draft202012Test extends JsonSchemaTestSuite: + import frawa.inlinefiles.InlineFilesWithHome.* + private val draft202012Files = draft202012.files() override protected val onlyDescription: Option[String] = diff --git a/typed-json/src/test/scala/frawa/typedjson/jsonSchemaTestSuite/JsonSchemaTestSuite.scala b/typed-json/src/test/scala/frawa/typedjson/jsonSchemaTestSuite/JsonSchemaTestSuite.scala index a6f98510..9fd8e61a 100644 --- a/typed-json/src/test/scala/frawa/typedjson/jsonSchemaTestSuite/JsonSchemaTestSuite.scala +++ b/typed-json/src/test/scala/frawa/typedjson/jsonSchemaTestSuite/JsonSchemaTestSuite.scala @@ -16,7 +16,7 @@ package frawa.typedjson.jsonSchemaTestSuite -import frawa.inlinefiles.InlineFiles +import frawa.inlinefiles.InlineFilesWithHome import frawa.typedjson.eval.CacheState.R import frawa.typedjson.eval.* import frawa.typedjson.eval.Util.{doApply, withCompiledSchemaValue} @@ -35,9 +35,13 @@ import frawa.typedjson.output.SimpleOutput.given import java.net.URI import frawa.typedjson.eval.CacheState import frawa.typedjson.eval.Util.doApplyBulk +import scala.annotation.experimental +@experimental open class JsonSchemaTestSuite extends FunSuite: - protected val draft202012 = InlineFiles.inlineDeepTextFiles("./JSON-Schema-Test-Suite/tests/draft2020-12", ".json") + @experimental + protected val draft202012 = + InlineFilesWithHome.inlineDeepTextFiles("./JSON-Schema-Test-Suite/tests/draft2020-12", ".json")("INLINE_HOME") protected val ignoreFiles: Seq[String] = Seq() @@ -116,6 +120,7 @@ open class JsonSchemaTestSuite extends FunSuite: case _ => fail("invalid test json") private def expectAll(schemaValue: SchemaValue, expactations: Seq[Expectation]): Unit = + @experimental val lazyResolver = (uri: URI) => MetaSchemas.lazyResolver(uri).orElse(Remotes.lazyResolver(uri)) val lr = Some(lazyResolver) val evalBasic = Eval[R, SimpleOutput] diff --git a/typed-json/src/test/scala/frawa/typedjson/jsonSchemaTestSuite/Remotes.scala b/typed-json/src/test/scala/frawa/typedjson/jsonSchemaTestSuite/Remotes.scala index bf21229b..303394c8 100644 --- a/typed-json/src/test/scala/frawa/typedjson/jsonSchemaTestSuite/Remotes.scala +++ b/typed-json/src/test/scala/frawa/typedjson/jsonSchemaTestSuite/Remotes.scala @@ -21,7 +21,9 @@ import frawa.typedjson.parser.* import frawa.typedjson.util.UriUtil import java.net.URI +import scala.annotation.experimental +@experimental object Remotes: val remotesUri: URI = UriUtil.uri("http://localhost:1234") @@ -31,6 +33,7 @@ object Remotes: else None } + @experimental private def resolveRemotes(relative: URI): Option[RootSchemaValue] = if relative.getFragment != null then None else @@ -39,4 +42,5 @@ object Remotes: import frawa.typedjson.macros.Macros.* - private val remotesFiles = inlineJsonContents("./JSON-Schema-Test-Suite/remotes", ".json") + @experimental + private val remotesFiles = inlineJsonContents("./JSON-Schema-Test-Suite/remotes", ".json")("INLINE_HOME") diff --git a/typed-json/src/test/scala/frawa/typedjson/keywords/SpecMetaSchemasTest.scala b/typed-json/src/test/scala/frawa/typedjson/keywords/SpecMetaSchemasTest.scala index 274e5472..80b2da48 100644 --- a/typed-json/src/test/scala/frawa/typedjson/keywords/SpecMetaSchemasTest.scala +++ b/typed-json/src/test/scala/frawa/typedjson/keywords/SpecMetaSchemasTest.scala @@ -21,7 +21,9 @@ import frawa.typedjson.util.UriUtil.* import munit.FunSuite import java.net.URI +import scala.annotation.experimental +@experimental class SpecMetaSchemasTest extends FunSuite: val schemaId = "https://json-schema.org/draft/2020-12/schema" diff --git a/typed-json/src/test/scala/frawa/typedjson/meta/MetaSchemaTest.scala b/typed-json/src/test/scala/frawa/typedjson/meta/MetaSchemaTest.scala index c696aaca..c43a4ac9 100644 --- a/typed-json/src/test/scala/frawa/typedjson/meta/MetaSchemaTest.scala +++ b/typed-json/src/test/scala/frawa/typedjson/meta/MetaSchemaTest.scala @@ -27,9 +27,12 @@ import frawa.typedjson.output.SimpleOutput import frawa.typedjson.output.SimpleOutput.given import frawa.typedjson.eval.Util.doApplyWithStats import frawa.typedjson.output.OutputOps +import scala.annotation.experimental +@experimental class MetaSchemaTest extends FunSuite: + @experimental private val resolver = MetaSchemas.lazyResolver private val base = MetaSchemas.draft202012 diff --git a/typed-json/src/test/scala/frawa/typedjson/output/OutputJsonTest.scala b/typed-json/src/test/scala/frawa/typedjson/output/OutputJsonTest.scala index bcba3b11..e9a3e36a 100644 --- a/typed-json/src/test/scala/frawa/typedjson/output/OutputJsonTest.scala +++ b/typed-json/src/test/scala/frawa/typedjson/output/OutputJsonTest.scala @@ -32,7 +32,9 @@ import frawa.typedjson.keywords.KeywordLocation import frawa.typedjson.parser.Value import frawa.typedjson.validation.AdditionalPropertyInvalid import frawa.typedjson.util.ShowValue.prettyPrint +import scala.annotation.experimental +@experimental class OutputJsonTest extends FunSuite: test("flag valid") { @@ -60,6 +62,7 @@ class OutputJsonTest extends FunSuite: import BasicOutput.given given parser: Parser = new JawnParser() + @experimental val typedJson = TypedJson.create(Sample.schema).toOption.get val (output, _) = typedJson.eval(parseJsonValue(Sample.value)) val basic = output.map(OutputJson.basic) diff --git a/typed-json/src/test/scala/frawa/typedjson/suggest/SuggestTest.scala b/typed-json/src/test/scala/frawa/typedjson/suggest/SuggestTest.scala index 9cf42463..14fc7355 100644 --- a/typed-json/src/test/scala/frawa/typedjson/suggest/SuggestTest.scala +++ b/typed-json/src/test/scala/frawa/typedjson/suggest/SuggestTest.scala @@ -36,7 +36,9 @@ import munit.Compare import frawa.typedjson.eval.Util.vocabularyForTest import frawa.typedjson.keywords.MetaKeyword import frawa.typedjson.util.UriUtil.uri +import scala.annotation.experimental +@experimental class SuggestTest extends FunSuite: // TODO avoid? @@ -73,6 +75,7 @@ class SuggestTest extends FunSuite: } private def assertSuggestForSchema(text: String, at: Pointer, keysOnly: Boolean)(f: SuggestResult => Unit): Unit = + @experimental val lazyResolver = MetaSchemas.lazyResolver val base = MetaSchemas.draft202012 val Some(schema) = lazyResolver(base.resolve("schema")): @unchecked diff --git a/typed-json/src/test/scala/samples/SamplesTest.scala b/typed-json/src/test/scala/samples/SamplesTest.scala index d67f12b6..f09a13ba 100644 --- a/typed-json/src/test/scala/samples/SamplesTest.scala +++ b/typed-json/src/test/scala/samples/SamplesTest.scala @@ -25,7 +25,9 @@ import frawa.typedjson.pointer.Pointer import frawa.typedjson.parser.Parser import frawa.typedjson.util.WithPointer import frawa.typedjson.testutil.TestUtil.parseJsonValue +import scala.annotation.experimental +@experimental class SamplesTest extends FunSuite: given Parser = new JawnParser() @@ -40,7 +42,8 @@ class SamplesTest extends FunSuite: test("use schema to validate several values") { val schemaJson = """{"type": "string"}""" - val typedJson = TypedJson.create(schemaJson).toOption.get + @experimental + val typedJson = TypedJson.create(schemaJson).toOption.get val validJson = parseJsonValue(""""foo"""") val (o, typedJson1) = typedJson.eval(validJson)