Closed bjornbak closed 1 year ago
Hello, @bjornbak Can you help me to identify the corner case you are describing here? I added several test cases covering (check PR #251)
all of these scenarios get compiled/executed perfectly fine so far
what is your case?
Answered as a PR comment https://github.com/andyglow/scala-jsonschema/pull/251#issuecomment-1033394546
@andyglow Any news on this issue? Still preventing me from upgrading from 0.6.0
@andyglow Now that you are picking up the project any change you can take a look at this. Still stuck at 0.6.0 :(
Sure, I will try to take a look. But in general it's a little bit tricky. Involves value evaluation, which is not what happens during compilation phase usually.
Do you have suggestion for a workaround other than not using default values?
hmm. i just tried your example in scastie https://scastie.scala-lang.org/andyglow/xOKY5B81RGONu2efiNElwQ/4
and it seems to be working @bjornbak, can you please double-check?
Hmm I see it is working in the scastie even if I add Schema generation..
But compile still fails on our code when doing:
val schemaJson: Json = Json
.schema[List[AnonSenConfiguration]]
.asCirce(Version.Draft07(id = s"http://example.com/anon-sen-config.json"))
On
final case class AnonSenConfiguration(
entity_label: String,
dataset: String,
small_entity_cutoff: Option[String] = None,
minimum_aggregated_data_size: Option[String] = None,
alerting_algorithms: List[String] = List(),
non_categorical_algorithm_configs: List[NonCategoricalAlgorithmConfigs] = List()
) extends Product with Serializable
I get:
[error] /tmp/workspace/scala213/dwh-preprocessor/src/main/scala/com/example/dwh/config/AnonSenConfigurationJsonSchemaGeneratorJob.scala:17:12: exception during macro expansion:
[error] java.lang.Exception: Unable to check isNone for com.example.dwh.config.models.AnonSenConfiguration.value small_entity_cutoff: Option[String]. May be try non-full rebuild. Throws on evaluation of:
[error] ```
[error] com.example.dwh.config.models.AnonSen.apply$default$3.isEmpty
[error] ```
[error] at com.github.andyglow.jsonschema.UProductTypes.$anonfun$com$github$andyglow$jsonschema$UProductTypes$$resolveFields$1(UProductTypes.scala:76)
[error] at com.github.andyglow.jsonschema.UCommons$OptionCompanionOps.whenever(UCommons.scala:174)
[error] at com.github.andyglow.jsonschema.UProductTypes.toField$1(UProductTypes.scala:45)
[error] at com.github.andyglow.jsonschema.UProductTypes.$anonfun$com$github$andyglow$jsonschema$UProductTypes$$resolveFields$6(UProductTypes.scala:144)
[error] at scala.collection.immutable.List.map(List.scala:250)
[error] at com.github.andyglow.jsonschema.UProductTypes.$anonfun$com$github$andyglow$jsonschema$UProductTypes$$resolveFields$4(UProductTypes.scala:144)
[error] at scala.Option.map(Option.scala:242)
[error] at com.github.andyglow.jsonschema.UProductTypes.com$github$andyglow$jsonschema$UProductTypes$$resolveFields(UProductTypes.scala:143)
[error] at com.github.andyglow.jsonschema.UProductTypes.com$github$andyglow$jsonschema$UProductTypes$$resolveFields$(UProductTypes.scala:35)
[error] at com.github.andyglow.jsonschema.Macroses.com$github$andyglow$jsonschema$UProductTypes$$resolveFields(Macroses.scala:141)
[error] at com.github.andyglow.jsonschema.UProductTypes$CaseClassExtractor.$anonfun$unapply$1(UProductTypes.scala:163)
[error] at com.github.andyglow.jsonschema.UCommons.forNonValueCaseClass(UCommons.scala:117)
[error] at com.github.andyglow.jsonschema.UCommons.forNonValueCaseClass$(UCommons.scala:109)
[error] at com.github.andyglow.jsonschema.Macroses.forNonValueCaseClass(Macroses.scala:141)
[error] at com.github.andyglow.jsonschema.UProductTypes$CaseClassExtractor.unapply(UProductTypes.scala:158)
[error] at com.github.andyglow.jsonschema.MacroCake.genTree$1(Macroses.scala:127)
[error] at com.github.andyglow.jsonschema.MacroCake.$anonfun$resolve$1(Macroses.scala:136)
[error] at scala.Option.getOrElse(Option.scala:201)
[error] at com.github.andyglow.jsonschema.UImplicits$Implicit.getOrElse(UImplicits.scala:86)
[error] at com.github.andyglow.jsonschema.MacroCake.resolve(Macroses.scala:136)
[error] at com.github.andyglow.jsonschema.MacroCake.resolve$(Macroses.scala:106)
[error] at com.github.andyglow.jsonschema.Macroses.resolve(Macroses.scala:141)
[error] at com.github.andyglow.jsonschema.UArrays$ArrExtractor.$anonfun$unapply$1(UArrays.scala:12)
[error] at com.github.andyglow.jsonschema.UCommons$SomeCompanionOps.when(UCommons.scala:169)
[error] at com.github.andyglow.jsonschema.UArrays$ArrExtractor.unapply(UArrays.scala:9)
[error] at com.github.andyglow.jsonschema.MacroCake.genTree$1(Macroses.scala:124)
[error] at com.github.andyglow.jsonschema.MacroCake.$anonfun$resolve$1(Macroses.scala:136)
[error] at scala.Option.getOrElse(Option.scala:201)
[error] at com.github.andyglow.jsonschema.UImplicits$Implicit.getOrElse(UImplicits.scala:86)
[error] at com.github.andyglow.jsonschema.MacroCake.resolve(Macroses.scala:136)
[error] at com.github.andyglow.jsonschema.MacroCake.resolve$(Macroses.scala:106)
[error] at com.github.andyglow.jsonschema.Macroses.resolve(Macroses.scala:141)
[error] at com.github.andyglow.jsonschema.MacroCake.deriveInternal(Macroses.scala:87)
[error] at com.github.andyglow.jsonschema.MacroCake.deriveInternal$(Macroses.scala:73)
[error] at com.github.andyglow.jsonschema.Macroses.deriveInternal(Macroses.scala:141)
[error] at com.github.andyglow.jsonschema.MacroCake.deriveSchema(Macroses.scala:56)
[error] at com.github.andyglow.jsonschema.MacroCake.deriveSchema$(Macroses.scala:56)
[error] at com.github.andyglow.jsonschema.Macroses.deriveSchema(Macroses.scala:141)
[error] Caused by: java.lang.AssertionError: assertion failed: pkgClass = package <root>, sym = package com, existing = package com (depth=0)
[error] at scala.reflect.internal.SymbolTable.throwAssertionError(SymbolTable.scala:171)
[error] at scala.reflect.runtime.SymbolLoaders$PackageScope.enter(SymbolLoaders.scala:120)
[error] at scala.reflect.internal.Importers$StandardImporter.$anonfun$importSymbol$6(Importers.scala:210)
[error] at scala.reflect.internal.Symbols$Symbol.orElse(Symbols.scala:2647)
[error] at scala.reflect.internal.Importers$StandardImporter.recreateOrRelink$1(Importers.scala:206)
[error] at scala.reflect.internal.Importers$StandardImporter.importSymbol(Importers.scala:223)
[error] at scala.reflect.internal.Importers$StandardImporter.recreatedTreeCompleter(Importers.scala:312)
[error] at scala.reflect.internal.Importers$StandardImporter.$anonfun$importTree$1(Importers.scala:432)
[error] at scala.reflect.internal.Importers$StandardImporter.tryFixup(Importers.scala:61)
[error] at scala.reflect.internal.Importers$StandardImporter.importTree(Importers.scala:433)
[error] at scala.reflect.internal.Importers$StandardImporter.recreateTree(Importers.scala:397)
[error] at scala.reflect.internal.Importers$StandardImporter.importTree(Importers.scala:430)
[error] at scala.reflect.internal.Importers$StandardImporter.recreateTree(Importers.scala:397)
[error] at scala.reflect.internal.Importers$StandardImporter.importTree(Importers.scala:430)
[error] at scala.reflect.internal.Importers$StandardImporter.recreateTree(Importers.scala:397)
[error] at scala.reflect.internal.Importers$StandardImporter.importTree(Importers.scala:430)
[error] at scala.reflect.internal.Importers$StandardImporter.recreateTree(Importers.scala:397)
[error] at scala.reflect.internal.Importers$StandardImporter.importTree(Importers.scala:430)
[error] at scala.reflect.internal.Importers$StandardImporter.recreateTree(Importers.scala:397)
[error] at scala.reflect.internal.Importers$StandardImporter.importTree(Importers.scala:430)
[error] at scala.reflect.internal.Importers$StandardImporter.recreateTree(Importers.scala:397)
[error] at scala.reflect.internal.Importers$StandardImporter.importTree(Importers.scala:430)
[error] at scala.reflect.internal.Importers$StandardImporter.recreateTree(Importers.scala:397)
[error] at scala.reflect.internal.Importers$StandardImporter.importTree(Importers.scala:430)
[error] at scala.reflect.internal.Importers$StandardImporter.importTree(Importers.scala:41)
[error] at scala.reflect.macros.contexts.Evals.eval(Evals.scala:37)
[error] at scala.reflect.macros.contexts.Evals.eval$(Evals.scala:26)
[error] at scala.reflect.macros.contexts.Context.eval(Context.scala:18)
[error] at com.github.andyglow.jsonschema.UProductTypes.$anonfun$com$github$andyglow$jsonschema$UProductTypes$$resolveFields$1(UProductTypes.scala:69)
[error] at com.github.andyglow.jsonschema.UCommons$OptionCompanionOps.whenever(UCommons.scala:174)
[error] at com.github.andyglow.jsonschema.UProductTypes.toField$1(UProductTypes.scala:45)
[error] at com.github.andyglow.jsonschema.UProductTypes.$anonfun$com$github$andyglow$jsonschema$UProductTypes$$resolveFields$6(UProductTypes.scala:144)
[error] at scala.collection.immutable.List.map(List.scala:250)
[error] at com.github.andyglow.jsonschema.UProductTypes.$anonfun$com$github$andyglow$jsonschema$UProductTypes$$resolveFields$4(UProductTypes.scala:144)
[error] at scala.Option.map(Option.scala:242)
[error] at com.github.andyglow.jsonschema.UProductTypes.com$github$andyglow$jsonschema$UProductTypes$$resolveFields(UProductTypes.scala:143)
[error] at com.github.andyglow.jsonschema.UProductTypes.com$github$andyglow$jsonschema$UProductTypes$$resolveFields$(UProductTypes.scala:35)
[error] at com.github.andyglow.jsonschema.Macroses.com$github$andyglow$jsonschema$UProductTypes$$resolveFields(Macroses.scala:141)
[error] at com.github.andyglow.jsonschema.UProductTypes$CaseClassExtractor.$anonfun$unapply$1(UProductTypes.scala:163)
[error] at com.github.andyglow.jsonschema.UCommons.forNonValueCaseClass(UCommons.scala:117)
[error] at com.github.andyglow.jsonschema.UCommons.forNonValueCaseClass$(UCommons.scala:109)
[error] at com.github.andyglow.jsonschema.Macroses.forNonValueCaseClass(Macroses.scala:141)
[error] at com.github.andyglow.jsonschema.UProductTypes$CaseClassExtractor.unapply(UProductTypes.scala:158)
[error] at com.github.andyglow.jsonschema.MacroCake.genTree$1(Macroses.scala:127)
[error] at com.github.andyglow.jsonschema.MacroCake.$anonfun$resolve$1(Macroses.scala:136)
[error] at scala.Option.getOrElse(Option.scala:201)
[error] at com.github.andyglow.jsonschema.UImplicits$Implicit.getOrElse(UImplicits.scala:86)
[error] at com.github.andyglow.jsonschema.MacroCake.resolve(Macroses.scala:136)
[error] at com.github.andyglow.jsonschema.MacroCake.resolve$(Macroses.scala:106)
[error] at com.github.andyglow.jsonschema.Macroses.resolve(Macroses.scala:141)
[error] at com.github.andyglow.jsonschema.UArrays$ArrExtractor.$anonfun$unapply$1(UArrays.scala:12)
[error] at com.github.andyglow.jsonschema.UCommons$SomeCompanionOps.when(UCommons.scala:169)
[error] at com.github.andyglow.jsonschema.UArrays$ArrExtractor.unapply(UArrays.scala:9)
[error] at com.github.andyglow.jsonschema.MacroCake.genTree$1(Macroses.scala:124)
[error] at com.github.andyglow.jsonschema.MacroCake.$anonfun$resolve$1(Macroses.scala:136)
[error] at scala.Option.getOrElse(Option.scala:201)
[error] at com.github.andyglow.jsonschema.UImplicits$Implicit.getOrElse(UImplicits.scala:86)
[error] at com.github.andyglow.jsonschema.MacroCake.resolve(Macroses.scala:136)
[error] at com.github.andyglow.jsonschema.MacroCake.resolve$(Macroses.scala:106)
[error] at com.github.andyglow.jsonschema.Macroses.resolve(Macroses.scala:141)
[error] at com.github.andyglow.jsonschema.MacroCake.deriveInternal(Macroses.scala:87)
[error] at com.github.andyglow.jsonschema.MacroCake.deriveInternal$(Macroses.scala:73)
[error] at com.github.andyglow.jsonschema.Macroses.deriveInternal(Macroses.scala:141)
[error] at com.github.andyglow.jsonschema.MacroCake.deriveSchema(Macroses.scala:56)
[error] at com.github.andyglow.jsonschema.MacroCake.deriveSchema$(Macroses.scala:56)
[error] at com.github.andyglow.jsonschema.Macroses.deriveSchema(Macroses.scala:141)
[error] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[error] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[error] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[error] at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[error] at scala.reflect.macros.runtime.JavaReflectionRuntimes$JavaReflectionResolvers.$anonfun$resolveJavaReflectionRuntime$5(JavaReflectionRuntimes.scala:45)
[error] at scala.tools.nsc.typechecker.Macros.macroExpandWithRuntime(Macros.scala:796)
[error] at scala.tools.nsc.typechecker.Macros.macroExpandWithRuntime$(Macros.scala:772)
[error] at scala.tools.nsc.Global$$anon$6.macroExpandWithRuntime(Global.scala:511)
[error] at scala.tools.nsc.typechecker.Macros$MacroExpander.$anonfun$expand$2(Macros.scala:601)
[error] at scala.tools.nsc.Global.withInfoLevel(Global.scala:254)
[error] at scala.tools.nsc.typechecker.Macros$MacroExpander.expand(Macros.scala:594)
[error] at scala.tools.nsc.typechecker.Macros$MacroExpander.apply(Macros.scala:556)
[error] at scala.tools.nsc.typechecker.Macros.standardMacroExpand(Macros.scala:757)
[error] at scala.tools.nsc.typechecker.Macros.standardMacroExpand$(Macros.scala:755)
[error] at scala.tools.nsc.Global$$anon$6.standardMacroExpand(Global.scala:511)
[error] at scala.tools.nsc.typechecker.AnalyzerPlugins$$anon$11.default(AnalyzerPlugins.scala:474)
[error] at scala.tools.nsc.typechecker.AnalyzerPlugins$$anon$11.default(AnalyzerPlugins.scala:471)
[error] at scala.tools.nsc.typechecker.AnalyzerPlugins.invoke(AnalyzerPlugins.scala:428)
[error] at scala.tools.nsc.typechecker.AnalyzerPlugins.pluginsMacroExpand(AnalyzerPlugins.scala:471)
[error] at scala.tools.nsc.typechecker.AnalyzerPlugins.pluginsMacroExpand$(AnalyzerPlugins.scala:471)
[error] at scala.tools.nsc.Global$$anon$6.pluginsMacroExpand(Global.scala:511)
[error] at scala.tools.nsc.typechecker.Macros.macroExpand(Macros.scala:746)
[error] at scala.tools.nsc.typechecker.Macros.macroExpand$(Macros.scala:739)
[error] at scala.tools.nsc.Global$$anon$6.macroExpand(Global.scala:511)
[error] at scala.tools.nsc.typechecker.Typers$Typer.vanillaAdapt$1(Typers.scala:1227)
[error] at scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1298)
[error] at scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1271)
[error] at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:6132)
[error] at scala.tools.nsc.typechecker.Typers$Typer.typedSelectOrSuperCall$1(Typers.scala:6215)
[error] at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:6062)
[error] at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:6117)
[error] at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typed1$41(Typers.scala:5130)
[error] at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:697)
[error] at scala.tools.nsc.typechecker.Typers$Typer.normalTypedApply$1(Typers.scala:5132)
[error] at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:5164)
[error] at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:6061)
[error] at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:6117)
[error] at scala.tools.nsc.typechecker.Typers$Typer.typedValDefImpl(Typers.scala:6381)
[error] at scala.tools.nsc.typechecker.Typers$Typer.typedValDef(Typers.scala:2124)
[error] at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:6022)
[error] at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:6117)
[error] at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:6195)
[error] at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$8(Typers.scala:3455)
[error] at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3455)
[error] at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:2078)
[error] at scala.tools.nsc.typechecker.Typers$Typer.typedModuleDef(Typers.scala:1954)
[error] at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:6025)
[error] at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:6117)
[error] at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:6195)
[error] at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$8(Typers.scala:3455)
[error] at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3455)
[error] at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5707)
[error] at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:6027)
[error] at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:6117)
[error] at scala.tools.nsc.typechecker.Analyzer$typerFactory$TyperPhase.apply(Analyzer.scala:124)
[error] at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:480)
[error] at scala.tools.nsc.typechecker.Analyzer$typerFactory$TyperPhase.run(Analyzer.scala:111)
[error] at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1545)
[error] at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1529)
[error] at scala.tools.nsc.Global$Run.compileSources(Global.scala:1521)
[error] at scala.tools.nsc.Global$Run.compileFiles(Global.scala:1634)
[error] at xsbt.CachedCompiler0.run(CompilerBridge.scala:163)
[error] at xsbt.CachedCompiler0.run(CompilerBridge.scala:134)
[error] at xsbt.CompilerBridge.run(CompilerBridge.scala:39)
[error] at sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:91)
[error] at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$7(MixedAnalyzingCompiler.scala:193)
[error] at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
[error] at sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:248)
[error] at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4(MixedAnalyzingCompiler.scala:183)
[error] at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4$adapted(MixedAnalyzingCompiler.scala:163)
[error] at sbt.internal.inc.JarUtils$.withPreviousJar(JarUtils.scala:239)
[error] at sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:163)
[error] at sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:211)
[error] at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:534)
[error] at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:534)
[error] at sbt.internal.inc.Incremental$.$anonfun$apply$5(Incremental.scala:179)
[error] at sbt.internal.inc.Incremental$.$anonfun$apply$5$adapted(Incremental.scala:177)
[error] at sbt.internal.inc.Incremental$$anon$2.run(Incremental.scala:463)
[error] at sbt.internal.inc.IncrementalCommon$CycleState.next(IncrementalCommon.scala:116)
[error] at sbt.internal.inc.IncrementalCommon$$anon$1.next(IncrementalCommon.scala:56)
[error] at sbt.internal.inc.IncrementalCommon$$anon$1.next(IncrementalCommon.scala:52)
[error] at sbt.internal.inc.IncrementalCommon.cycle(IncrementalCommon.scala:263)
[error] at sbt.internal.inc.Incremental$.$anonfun$incrementalCompile$8(Incremental.scala:418)
[error] at sbt.internal.inc.Incremental$.withClassfileManager(Incremental.scala:505)
[error] at sbt.internal.inc.Incremental$.incrementalCompile(Incremental.scala:405)
[error] at sbt.internal.inc.Incremental$.apply(Incremental.scala:171)
[error] at sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:534)
[error] at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:488)
[error] at sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:332)
[error] at sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:425)
[error] at sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:137)
[error] at sbt.Defaults$.compileIncrementalTaskImpl(Defaults.scala:2369)
[error] at sbt.Defaults$.$anonfun$compileIncrementalTask$2(Defaults.scala:2319)
[error] at sbt.internal.server.BspCompileTask$.$anonfun$compute$1(BspCompileTask.scala:31)
[error] at sbt.internal.io.Retry$.apply(Retry.scala:47)
[error] at sbt.internal.io.Retry$.apply(Retry.scala:29)
[error] at sbt.internal.io.Retry$.apply(Retry.scala:24)
[error] at sbt.internal.server.BspCompileTask$.compute(BspCompileTask.scala:31)
[error] at sbt.Defaults$.$anonfun$compileIncrementalTask$1(Defaults.scala:2317)
[error] at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:63)
[error] at sbt.std.Transform$$anon$4.work(Transform.scala:69)
[error] at sbt.Execute.$anonfun$submit$2(Execute.scala:283)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:24)
[error] at sbt.Execute.work(Execute.scala:292)
[error] at sbt.Execute.$anonfun$submit$1(Execute.scala:283)
[error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
[error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:65)
[error] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
[error] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[error] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[error] at java.base/java.lang.Thread.run(Thread.java:829)
[error] .schema[List[AnonSenConfiguration]]
I couldn't reliably reproduce it in the scastie and I solved it in our codebase too :) But I can't tell you how as it was a lucky break of:
:question: :grey_question: :thinking: but it is working :)
Still trying to upgrade from 0.6.2 to 0.7.x and hit another roadblock. I am not sure if this is a bug or a feature request. Please relabel it accordingly..
Describe the bug In our model hierarchy we have optional case classes which defaults to None containing a case class which also have an optional case class which defaults None.
This worked as expected in 0.6.2 but now it results in a
Unable to check isNone for
the inner case class.To Reproduce
Adding to object
SchemaMacroSpec
:and to class
AsCirceSpec
:Expected behavior Expected an schema generated (and the AsCirceSpec to fail because I compare the generated schema to an empty string).
Actual results But it results in a build error:
Versions:
Additional context Add any other context about the problem here.