Skip to content

Commit

Permalink
Code & dependencies cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
pomadchin committed Mar 30, 2022
1 parent 5dde972 commit 58013c1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
2 changes: 0 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,6 @@ lazy val client = crossProject(JSPlatform, JVMPlatform)
.settings(publishSettings)
.settings(
libraryDependencies ++= Seq(
"com.github.julien-truffaut" %%% "monocle-core" % Versions.Monocle,
"com.github.julien-truffaut" %%% "monocle-macro" % Versions.Monocle,
"io.circe" %%% "circe-core" % Versions.Circe,
"io.circe" %%% "circe-generic" % Versions.Circe,
"io.circe" %%% "circe-refined" % Versions.Circe,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ case class SearchFilters(
items: List[String] = Nil,
limit: Option[NonNegInt] = None,
query: Map[String, List[Query]] = Map.empty,
// according to the STAC Spec, any fields can be used to represent pagination
// for more details see https://github.com/radiantearth/stac-api-spec/tree/v1.0.0-rc.1/item-search#pagination
paginationBody: JsonObject = JsonObject.empty
)

Expand All @@ -26,12 +28,12 @@ object SearchFilters extends ClientCodecs {

implicit val searchFiltersDecoder: Decoder[SearchFilters] = { c =>
for {
bbox <- c.downField("bbox").as[Option[Bbox]]
datetime <- c.downField("datetime").as[Option[TemporalExtent]]
intersects <- c.downField("intersects").as[Option[Geometry]]
collectionsOption <- c.downField("collections").as[Option[List[String]]]
itemsOption <- c.downField("ids").as[Option[List[String]]]
limit <- c.downField("limit").as[Option[NonNegInt]]
bbox <- c.get[Option[Bbox]]("bbox")
datetime <- c.get[Option[TemporalExtent]]("datetime")
intersects <- c.get[Option[Geometry]]("intersects")
collectionsOption <- c.get[Option[List[String]]]("collections")
itemsOption <- c.get[Option[List[String]]]("ids")
limit <- c.get[Option[NonNegInt]]("limit")
query <- c.get[Option[Map[String, List[Query]]]]("query")
document <- c.value.as[JsonObject]
} yield {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ case class SearchFilters(
items: List[String] = Nil,
limit: Option[NonNegInt] = None,
query: Map[String, List[Query]] = Map.empty,
// according to the STAC Spec, any fields can be used to represent pagination
// for more details see https://github.com/radiantearth/stac-api-spec/tree/v1.0.0-rc.1/item-search#pagination
paginationBody: JsonObject = JsonObject.empty
)

Expand All @@ -26,12 +28,12 @@ object SearchFilters extends ClientCodecs {

implicit val searchFiltersDecoder: Decoder[SearchFilters] = { c =>
for {
bbox <- c.downField("bbox").as[Option[Bbox]]
datetime <- c.downField("datetime").as[Option[TemporalExtent]]
intersects <- c.downField("intersects").as[Option[Geometry]]
collectionsOption <- c.downField("collections").as[Option[List[String]]]
itemsOption <- c.downField("ids").as[Option[List[String]]]
limit <- c.downField("limit").as[Option[NonNegInt]]
bbox <- c.get[Option[Bbox]]("bbox")
datetime <- c.get[Option[TemporalExtent]]("datetime")
intersects <- c.get[Option[Geometry]]("intersects")
collectionsOption <- c.get[Option[List[String]]]("collections")
itemsOption <- c.get[Option[List[String]]]("ids")
limit <- c.get[Option[NonNegInt]]("limit")
query <- c.get[Option[Map[String, List[Query]]]]("query")
document <- c.value.as[JsonObject]
} yield {
Expand Down

0 comments on commit 58013c1

Please sign in to comment.