The `httpPrefixHeaders` trait is not supported by OpenAPI and was found on `com.amazonaws.s3#CreateMultipartUploadRequest$Metadata`
kkrs opened this issue · comments
I run into this error when running smithy4sCodeGen
> mill pb.smithy4sCodegen [? M][git:scalazzi/smithy4s-aws]
[37/37] pb.smithy4sCodegen
1 targets failed
pb.smithy4sCodegen software.amazon.smithy.openapi.OpenApiException: The `httpPrefixHeaders` trait is not supported by OpenAPI and was found on `com.amazonaws.s3#CreateMultipartUploadRequest$Metadata`
software.amazon.smithy.openapi.fromsmithy.mappers.CheckForPrefixHeaders.check(CheckForPrefixHeaders.java:78)
software.amazon.smithy.openapi.fromsmithy.mappers.CheckForPrefixHeaders.lambda$before$1(CheckForPrefixHeaders.java:55)
java.base/java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1715)
java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
software.amazon.smithy.openapi.fromsmithy.mappers.CheckForPrefixHeaders.before(CheckForPrefixHeaders.java:54)
software.amazon.smithy.openapi.fromsmithy.OpenApiMapper$1.before(OpenApiMapper.java:416)
software.amazon.smithy.openapi.fromsmithy.OpenApiConverter.convertWithEnvironment(OpenApiConverter.java:316)
software.amazon.smithy.openapi.fromsmithy.OpenApiConverter.convertToNode(OpenApiConverter.java:165)
alloy.openapi.package$.$anonfun$convertWithConfig$6(package.scala:85)
scala.collection.StrictOptimizedIterableOps.map(StrictOptimizedIterableOps.scala:100)
scala.collection.StrictOptimizedIterableOps.map$(StrictOptimizedIterableOps.scala:87)
scala.collection.immutable.Set$Set1.map(Set.scala:165)
alloy.openapi.package$.$anonfun$convertWithConfig$4(package.scala:78)
scala.collection.immutable.List.flatMap(List.scala:293)
alloy.openapi.package$.convertWithConfig(package.scala:75)
alloy.openapi.package$.convert(package.scala:115)
smithy4s.codegen.internals.CodegenImpl$.generate(CodegenImpl.scala:67)
smithy4s.codegen.Codegen$.generate(Codegen.scala:22)
smithy4s.codegen.Codegen$.generateToDisk(Codegen.scala:25)
smithy4s.codegen.mill.Smithy4sModule.$anonfun$smithy4sCodegen$3(Smithy4sModule.scala:224)
smithy-build.json looks like this (I've also tried multiple prefixes of "service": "com.amazonaws.s3#CreateMultipartUploadRequest
)
{
"version": "1.0",
"maven": {
"dependencies": [
"com.disneystreaming.alloy:alloy-core:0.3.7"
]
},
"plugins": {
"openapi": {
"service": "com.amazonaws.s3#CreateMultipartUploadRequest$Metadata",
"onHttpPrefixHeaders": "WARN",
"ignoreUnsupportedTraits": true
}
}
}
Also my build configuration has this
object pb extends SbtModule with Smithy4sModule with CommonModule {
import java.nio.file.{Paths, Path}
def scalaVersion = scala3Version
// override def smithy4sVersion = "0.18.16"
override def ivyDeps =
super.ivyDeps() ++ Agg(
ivy"com.disneystreaming.smithy4s::smithy4s-core:${smithy4sVersion()}",
ivy"com.disneystreaming.smithy4s::smithy4s-http4s-swagger:${smithy4sVersion()}",
ivy"com.disneystreaming.smithy4s::smithy4s-aws-http4s:${smithy4sVersion()}",
//ivy"com.disneystreaming.smithy:aws-s3-spec:2023.23.30",
//ivy"com.disneystreaming.smithy:aws-ec2-spec:2023.23.30",
//ivy"com.disneystreaming.smithy:aws-dynamodb-spec:2023.23.30",
ivy"org.http4s::http4s-ember-server:$http4sVersion",
ivy"org.http4s::http4s-ember-client:$http4sVersion"
)
override def smithy4sAwsSpecs: T[Seq[String]] = T(Seq(
AWS.dynamodb,
AWS.s3,
AWS.ec2,
))
...
}
Ugh, wrong repository.