Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
fupelaqu committed Dec 19, 2024
2 parents 3602b51 + ac2c1fd commit 9f3ec2f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import io.swagger.v3.parser.OpenAPIV3Parser
import io.swagger.v3.parser.core.models.ParseOptions

import java.util.regex.Pattern
import scala.collection.View
import scala.jdk.CollectionConverters._
import scala.util.Try

Expand Down Expand Up @@ -484,7 +483,7 @@ class OpenAPISchemaExtractor(
currentSchema: OpenAPISwaggerSchema[_],
currentPath: Option[String] = None
): OpenAPISwaggerSchema[_] = {
def handleObjectSchema(os: OpenAPISwaggerSchema[_]) = {
def handleObjectSchema(os: OpenAPISwaggerSchema[_]): OpenAPISwaggerSchema[_] = {
val newProperties = os.getProperties.asScala
.filter { case (name, _) =>
!fieldPatterns.exists(
Expand All @@ -494,7 +493,7 @@ class OpenAPISchemaExtractor(
.map { case (name, pSchema) =>
name -> processExclusion(pSchema, currentPath.map(_ + "_" + name))
}
.toMap
.toMap[String, OpenAPISwaggerSchema[_]]
.asJava
os.setProperties(newProperties)
os
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import ai.starlake.core.utils.{
TableAttributeMelderConfig,
TableMelderConfig
}
import ai.starlake.schema.model.{Attribute, Domain, Metadata, Schema, TransformInput}
import ai.starlake.schema.model.{Attribute, Domain, Metadata, Schema}
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,14 @@ import ai.starlake.config.Settings.{
import ai.starlake.config.{ApplicationDesc, Settings}
import ai.starlake.extract._
import ai.starlake.extract.impl.openapi.{
All,
Get,
HttpOperation,
OpenAPIDomain,
OpenAPIExtractSchema,
OpenAPIRoute,
OpenAPIRouteExplosion,
OpenAPISchema,
Post,
RouteExplosionStrategy
Post
}
import ai.starlake.job.load.{IngestionNameStrategy, IngestionTimeStrategy}
import ai.starlake.schema.model._
Expand All @@ -52,7 +50,7 @@ import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks
import java.util.TimeZone
import java.util.regex.Pattern
import scala.jdk.CollectionConverters._
import scala.util.{Failure, Success, Try}
import scala.util.{Failure, Success}

class YamlSerdeSpec extends TestHelper with ScalaCheckPropertyChecks with TryValues {
new WithSettings() {
Expand Down Expand Up @@ -659,7 +657,7 @@ object YamlConfigGenerators {
implicit val openAPIExtractSchema: Arbitrary[OpenAPIExtractSchema] = Arbitrary {
for {
basePath <- arbitrary[Option[String]]
formatTypeMapping <- arbitrary[Map[String, Pattern]].map(_.view.mapValues(_.toString).toMap)
formatTypeMapping <- arbitrary[Map[String, Pattern]].map(_.mapValues(_.toString).toMap)
domains <- arbitrary[List[OpenAPIDomain]].filter(_.nonEmpty)
} yield OpenAPIExtractSchema(
basePath = basePath,
Expand Down

0 comments on commit 9f3ec2f

Please sign in to comment.