-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
Improvement
Schema derivation for case classes depends on Schema[T] being available for all the components. Not just that it could be available -- for exotic types it actually has to exist beforehand (see coproduct types). We should provide a tapir module that provides Schema implicits for all the data types in stac4s. Most of it will be derivable.
Some of the derivations will be incorrect though. for instance the automatic derivation thinks that TwoDimBbox is an object:
@ implicit val twoDimBboxSchema = implicitly[Schema[com.azavea.stac4s.TwoDimBbox]]
twoDimBboxSchema: Schema[TwoDimBbox] = Schema(
SProduct(
SObjectInfo("com.azavea.stac4s.TwoDimBbox", List()),
List(
("xmin", Schema(SNumber, false, None, Some("double"), false)),
("ymin", Schema(SNumber, false, None, Some("double"), false)),
("xmax", Schema(SNumber, false, None, Some("double"), false)),
("ymax", Schema(SNumber, false, None, Some("double"), false))
)
),
false,
None,
None,
false
) And the automatic derivation for StacLink is a null:
@ implicit val stacLinkSchema: Schema[StacLink] = implicitly[Schema[StacLink]
]
stacLinkSchema: Schema[StacLink] = nullNotes + Context
This is to support downstream not having to create stac4s schemas in different places, since Schema[T] + Codec[T] in the json lib is normally sufficient for Codec[T] in tapir
Metadata
Metadata
Assignees
Labels
No labels