-
Notifications
You must be signed in to change notification settings - Fork 422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
codegen: Support enums in paths #3889
Conversation
@@ -169,10 +172,6 @@ object BasicGenerator { | |||
| case Some(values) => DecodeResult.sequence(values.split(',').toSeq.map(e => support.rawDecode(List(e)))).map(r => Some(CommaSeparatedValues(r.toList))) | |||
| }(_.map(_.values.map(support.encode).mkString(","))) | |||
|} | |||
|implicit def makeExplodedQuerySeqCodecFromSupport[T](implicit support: QueryParamSupport[T]): sttp.tapir.Codec[List[String], ExplodedValues[T], sttp.tapir.CodecFormat.TextPlain] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we now provide a Codec[String, T, sttp.tapir.CodecFormat.TextPlain]
, from which we can derive a Codec[List[String], List[T], sttp.tapir.CodecFormat.TextPlain]
, the final implicit derivation is provided by makeExplodedQuerySeqCodecFromListSeq
and this is now redundant (it also causes explicit resolution conflicts in scala 3 if left in, although scala 2 seems happy enough with the ambiguity for some reason).
.leftMap(err => err: Error) | ||
.flatMap(_.as[OpenapiDocument]) shouldBe Right( | ||
TestHelpers.enumQueryParamDocs | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test was previously missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@hughsimpson I'd like to release |
@kciesielski I've got nothing else I need, would love a 1.10.11! 🎉 |
Support enums in path params. Most of the diff here is just renaming variables and types to reflect that they no longer pertain only to query params, but also to path params; nearly all of the implementation is supported just by reusing those existing mechanisms