Skip to content

Commit

Permalink
Workaround for #1897
Browse files Browse the repository at this point in the history
  • Loading branch information
blast-hardcheese committed Dec 17, 2023
1 parent 166b3d4 commit 4a64db6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/core/src/main/scala/dev/guardrail/Common.scala
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ object Common {
server
.downField("url", _.getUrl)
.unwrapTracker
.filterNot(_.contains("{"))
.map { x =>
val uri = new URI(x.iterateWhileM[Id](_.stripSuffix("/"))(_.endsWith("/")))
@SuppressWarnings(Array("org.wartremover.warts.Null"))
Expand All @@ -64,6 +65,7 @@ object Common {
basePath = swagger
.downField("servers", _.getServers)
.cotraverse(_.downField("url", _.getUrl))
.filterNot(_.unwrapTracker.exists(_.contains("{")))
.headOption
.flatMap(_.unwrapTracker)
.flatMap(url => Option(new URI(url).getPath))
Expand Down

0 comments on commit 4a64db6

Please sign in to comment.