Today I’m pulling a 24K line OpenAPI spec into Tapir using Generate endpoint definitions from an OpenAPI YAML — Tapir 1.x documentation .
I’m down from 600 errors at start to just 29 errors in the generated code. I think all are variations on
[error] – [E172] Type Error: /Users/dwalend/projects/apispecs/nifi/target/scala-3.3.6/src_managed/main/sbt-openapi-codegen/Connections.scala:52:49
[error] 52 | .in(queryOption[LongParameter].description(“The revision is used to verify the client is working with the latest version of the flow.”))
[error] | ^
[error] |Cannot find a codec between types: List[String] and Option[com.macrohealth.platform.api.nifi.NifiFromOpenApi.LongParameter], formatted as: sttp.tapir.CodecFormat.TextPlain.
[error] |Did you define a codec for: Option[com.macrohealth.platform.api.nifi.NifiFromOpenApi.LongParameter]?
[error] |Did you import the codecs for: sttp.tapir.CodecFormat.TextPlain?
[error] |.
[error] |I found:
[error] |
[error] | sttp.tapir.Codec.listHeadOption[String,
[error] | com.macrohealth.platform.api.nifi.NifiFromOpenApi.LongParameter, CF](
[error] | sttp.tapir.Codec.derivedStringBasedUnionEnumeration
[error] | com.macrohealth.platform.api.nifi.NifiFromOpenApi.LongParameter
[error] | )
[error] |
[error] |But macro expansion was stopped.
What’s the right fix for these? (I’ve fixed most problems by adding new libraries to the classpath. Is it just adding another .jar file into the classpath?)
Thanks,
David