Skip to content

Releases: snowplow/iglu-scala-client

4.0.0

30 Sep 13:49
Compare
Choose a tag to compare

Changelog

  • Add caching to lookupSchemasUntil function (#258)

3.2.0

20 Aug 22:29
Compare
Choose a tag to compare

Changelog

  • Add a function that discovers and looks up schemas without using the list endpoint of an Iglu server (#256)
  • maxJsonDepth when validating JSON (#254)

3.1.1

09 Jul 09:52
Compare
Choose a tag to compare

Changelog

  • Fix listSchemasLike when multiple Iglu repositories host the schemas (#252)

Version 3.1.0

09 Jun 13:50
Compare
Choose a tag to compare

Adds two new low-level features to improve how the client handles various failure scenarios. More details are in the linked issues.

Changelog

  • Not Found results should be cached for as long as the TTL (#248)
  • Http4s client should implement a retry policy (#246)

3.0.0

30 May 13:03
Compare
Choose a tag to compare

What's Changed

  • Embedded and in-memory lookups should be common across http modules (#244)
  • Take superseding schema into account during validation (#231)
  • Apps should explicitly import java.net.http.HttpClient instances of RegistryLookup (#241)
  • Resolver caches suffers from races and http server overload during the cold start (#227)
  • Ignore $ref keyword referencing HTTP resources (#238)

Full Changelog: 2.2.1...3.0.0

2.2.1

24 Jan 10:17
Compare
Choose a tag to compare

This release adds support for Scala 3. Many thanks to @hamnis for contributing the work for this release.

Changelog

  • Update links in Readme (#205)
  • Rename license file for GitHub (#204)
  • Update copyright notice to 2023 (#225)
  • Build and publish for Scala3 (#224)

2.2.0

23 Nov 16:15
Compare
Choose a tag to compare

Iglu Scala Client 2.2.0 and 1.3.0 released

We are very pleased to announce versions 2.2.0 and 1.3.0 of Iglu Scala Client. We keep maintaining both 2.x and 1.x
branches for Cats Effect (CE) 3 and CE2 respectively.

Iglu scala client is a client implementation for the Iglu schema repository.
It is extensively used by Snowplow pipeline components for accessing the Iglu server though HTTP, as well as for test purposes
with static iglu repositories.

Allow building caches based on the resolver's content

This feature was available in earlier release for 1.x branch in 1.2.0. But it is new for the 2.x branch.

In iglu-scala-client, the client provide two core functionalities:

  1. The resolver, which can lookup schemas (or a list of schemas)
  2. The validator, which can validate data against resolved schema

We already had a cache for the resolver. Here, we introduce a cache in the validator.

Currently, for every validation we convert a schema returned from the resolver to the JsonSchema instance from the com.networknt library as part of validating the schema. This operation proved to be expensive in our tests, so we wanted to cache it. For a given schema key, if the corresponding schema from the resolver does not change, then neither will the the result of converting the schema to a JsonSchema instance from the com.networknt library.

However, in some rare cases, schemas do change even though our recommendation remains that if a schema changes, the schema's version should be updated. See our docs on versioning here.

So, we have introduced a pattern that will enable us to create caches that need to eventually update if the corresponding schema cached by the resolver has been updated. This pattern has been described in more detail here. This will allow us to introduce caches to improve performance even in cases where that cache needs to keep up with updates to schemas.

Schema List Improvements

In the anticipation to the upcoming changes to the transformer, we added the schema listing capability for embedded
repositories.

With schema caching introduced in 1.2.0, the client would return a stale version of schema list when a new schema was added.
This happened because it had no means to invalidate the cache. This could cause events to fail validation whenever they used a new schema
version that was not yet in the cache. We added a safe method that invalidates the cache when a referenced schema
version is not found. This makes sure new schema versions are not missed.

Upgrading

If you are already using version older version bump libraryDependencies in your build.sbt:

libraryDependencies += "com.snowplowanalytics" %% "iglu-scala-client" % "1.3.0"

Or if you using Cats Effect 3:

libraryDependencies += "com.snowplowanalytics" %% "iglu-scala-client" % "2.2.0"

1.3.0

23 Nov 16:16
Compare
Choose a tag to compare

Iglu Scala Client 2.2.0 and 1.3.0 released

We are very pleased to announce versions 2.2.0 and 1.3.0 of Iglu Scala Client. We keep maintaining both 2.x and 1.x
branches for Cats Effect (CE) 3 and CE2 respectively.

Iglu scala client is a client implementation for the Iglu schema repository.
It is extensively used by Snowplow pipeline components for accessing the Iglu server though HTTP, as well as for test purposes
with static iglu repositories.

Allow building caches based on the resolver's content

This feature was available in earlier release for 1.x branch in 1.2.0. But it is new for the 2.x branch.

In iglu-scala-client, the client provide two core functionalities:

  1. The resolver, which can lookup schemas (or a list of schemas)
  2. The validator, which can validate data against resolved schema

We already had a cache for the resolver. Here, we introduce a cache in the validator.

Currently, for every validation we convert a schema returned from the resolver to the JsonSchema instance from the com.networknt library as part of validating the schema. This operation proved to be expensive in our tests, so we wanted to cache it. For a given schema key, if the corresponding schema from the resolver does not change, then neither will the the result of converting the schema to a JsonSchema instance from the com.networknt library.

However, in some rare cases, schemas do change even though our recommendation remains that if a schema changes, the schema's version should be updated. See our docs on versioning here.

So, we have introduced a pattern that will enable us to create caches that need to eventually update if the corresponding schema cached by the resolver has been updated. This pattern has been described in more detail here. This will allow us to introduce caches to improve performance even in cases where that cache needs to keep up with updates to schemas.

Schema List Improvements

In the anticipation to the upcoming changes to the transformer, we added the schema listing capability for embedded
repositories.

With schema caching introduced in 1.2.0, the client would return a stale version of schema list when a new schema was added.
This happened because it had no means to invalidate the cache. This could cause events to fail validation whenever they used a new schema
version that was not yet in the cache. We added a safe method that invalidates the cache when a referenced schema
version is not found. This makes sure new schema versions are not missed.

Upgrading

If you are already using version older version bump libraryDependencies in your build.sbt:

libraryDependencies += "com.snowplowanalytics" %% "iglu-scala-client" % "1.3.0"

Or if you using Cats Effect 3:

libraryDependencies += "com.snowplowanalytics" %% "iglu-scala-client" % "2.2.0"

1.2.0

05 Oct 10:59
Compare
Choose a tag to compare

Release containing caching improvements for branch 1.x (based on Cats Effect 2). See more detailed description of improvements in #207

Changelog

  • Allow building caches based on the resolver's content (#207)

2.1.0

31 May 17:11
Compare
Choose a tag to compare

This release introduces new data module containing core data classes used by client. New module can be used directly by different libraries/application where basic ADTs are required and features of the client interface from core are not needed.

Moreover, this release contains dependencies cleanup - upgrades and replacing deprecated ones.

Changelog

  • Bump specs2 to 4.15.0 (#198)
  • Bump http4s to 0.23.12 (#197)
  • Bump scala-collection-compat to 2.7.0 (#196)
  • Bump circe to 0.14.2 (#195)
  • Bump cats-effect to 3.3.12 (#194)
  • Bump jackson-databind to 2.13.3 (#192)
  • Bump json-schema-validator to 1.0.70 (#193)
  • Replace deprecated scalaj http client (#190)
  • Use jsonschema v4 text from iglu-scala-core (#186)
  • Split out a iglu-scala-client-data module (#187)