Open jgulotta opened 10 months ago
Hi @jgulotta - I can confirm that this is an issue. That PR you referenced is a bit of a mess. I need to work out whether it is best to abandon the ErasureHelper or try to keep digging a bigger hole for it.
In the mean time, I suggest that you stick with an older swagger-scala-module jar.
@jgulotta I added a fix - https://github.com/swagger-akka-http/swagger-scala-module/pull/310
This may not cover deeply nested strutures (eg option of seq of option of T) but it is hopefully enough for Option[Set[String]]
.
I don't use swagger any more - and not in a number of years. So, I would appreciate if you could try out the snapshot releases of swagger-scala-module. 2.12.0+7-ff3a38d1-SNAPSHOT has the #310 change in it.
You can work out the latest snapshot releases by looking at https://oss.sonatype.org/content/repositories/snapshots/com/github/swagger-akka-http/swagger-scala-module_2.13/ or checking the logs from the GitHub Action builds for this project.
Verified the snapshot solves the problem and all looks good, thanks!
Can I ask for a fix to the "incorrect behavior cannot be overridden by adding an ArraySchema annotation" part too? I think it would be making
val schemaOverride = propertyAnnotations.collectFirst { case s: SchemaAnnotation => s }
and subsequent code handle ArraySchema
in addition to Schema
Can I ask for a fix to the "incorrect behavior cannot be overridden by adding an ArraySchema annotation" part too? I think it would be making
val schemaOverride = propertyAnnotations.collectFirst { case s: SchemaAnnotation => s }
and subsequent code handle
ArraySchema
in addition toSchema
As I stated earlier, I am not using swagger for anything. This lib is not a major priority for me. If you want to submit a PR, I will look at it but I have limited time and am focused on non-swagger work.
I have https://github.com/swagger-akka-http/swagger-scala-module/pull/312 but I still need to fix one of the tests
As I stated earlier, I am not using swagger for anything. This lib is not a major priority for me. If you want to submit a PR, I will look at it but I have limited time and am focused on non-swagger work.
Totally fair! I appreciate the speed and attention you've given so far
Given the class
In 2.12.0 the schema incorrectly renders as
In 2.7.2 the schema correctly renders as
Moreover, the incorrect behavior cannot be overridden by adding an
ArraySchema
annotationI suspect this is due to #174 and would apply recursively to any nested structure that eventually has a primitive as the first type parameter. Sorry about the late report on what is now an old change; we've only recently gone about updating our swagger codegen and encountered the problem