-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Renaming packages for spray & play json. * Fixing pekko-http Scala 2/3 division. * Refactoring tests for doobie. * Refactoring circe tests. * Cleaning up http4s package. * Adding previously removed doobie tests. * Refactor of scalacheck package * Mergin spray-json-macros and spray-json. * Fixing akka-http to work with generic EnumLike * Merging pekko-http tests. * Removing bunch of useless classtags * Merging http4s-stir implementation and tests. * Removing legacy `sv` from build.sbt * Cleaning up akka-http, pekko-http and http4s-stir. * Circe cleanup. * Naming fix Enum -> Enums in Circe * Doobie cleanup. * Http4s cleanup * jsonschema cleanup * Cleaning up play-json, adding enums. * Fixing scalacheck * Slick trait visibility fix. * Cleanup spray-json. * Cleanup tagged.
- Loading branch information
Showing
138 changed files
with
944 additions
and
2,383 deletions.
There are no files selected for viewing
15 changes: 6 additions & 9 deletions
15
...kebs/akkahttp/matchers/KebsMatchers.scala → ...ahttp/matchers/KebsAkkaHttpMatchers.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,21 @@ | ||
package pl.iterators.kebs.akkahttp.matchers | ||
|
||
import akka.http.scaladsl.server.{PathMatcher1, PathMatchers} | ||
import enumeratum.{Enum, EnumEntry} | ||
import pl.iterators.kebs.core.enums.{EnumLike, ValueEnumLike, ValueEnumLikeEntry} | ||
import pl.iterators.kebs.core.instances.InstanceConverter | ||
import pl.iterators.kebs.core.macros.ValueClassLike | ||
|
||
trait KebsMatchers extends PathMatchers { | ||
|
||
trait KebsAkkaHttpMatchers extends PathMatchers { | ||
implicit class SegmentIsomorphism[U](segment: PathMatcher1[U]) { | ||
def as[T](implicit rep: ValueClassLike[T, U]): PathMatcher1[T] = segment.map(rep.apply) | ||
def as[T](implicit rep: ValueClassLike[T, U]): PathMatcher1[T] = segment.map(rep.apply) | ||
def asValueEnum[T <: ValueEnumLikeEntry[U]](implicit e: ValueEnumLike[U, T]): PathMatcher1[T] = segment.map(e.withValue) | ||
} | ||
|
||
implicit class SegmentConversion[Source](segment: PathMatcher1[Source]) { | ||
def to[Type](implicit ico: InstanceConverter[Type, Source]): PathMatcher1[Type] = segment.map(ico.decode) | ||
} | ||
|
||
object EnumSegment { | ||
def as[T <: EnumEntry: Enum]: PathMatcher1[T] = { | ||
val enumCompanion = implicitly[Enum[T]] | ||
Segment.map(enumCompanion.withNameInsensitive) | ||
} | ||
implicit class SegmentEnumIsomorphism[U](segment: PathMatcher1[String]) { | ||
def asEnum[T](implicit e: EnumLike[T]): PathMatcher1[T] = segment.map(e.withNameIgnoreCase) | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
akka-http/src/main/scala/pl/iterators/kebs/akkahttp/matchers/package.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
package pl.iterators.kebs.akkahttp | ||
|
||
package object matchers extends KebsMatchers | ||
package object matchers extends KebsAkkaHttpMatchers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 0 additions & 26 deletions
26
akka-http/src/main/scala/pl/iterators/kebs/akkahttp/unmarshallers/KebsUnmarshallers.scala
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
akka-http/src/main/scala/pl/iterators/kebs/akkahttp/unmarshallers/enums/package.scala
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
akka-http/src/main/scala/pl/iterators/kebs/akkahttp/unmarshallers/package.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
package pl.iterators.kebs.akkahttp | ||
|
||
package object unmarshallers extends KebsUnmarshallers | ||
package object unmarshallers extends KebsAkkaHttpUnmarshallers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.