Skip to content

Commit

Permalink
Merge pull request #2045 from aml-org/publish-5.6.1-master
Browse files Browse the repository at this point in the history
Publish 5.6.1
  • Loading branch information
looseale authored Sep 24, 2024
2 parents dfe830f + 5e6846c commit cd063dc
Show file tree
Hide file tree
Showing 17 changed files with 62 additions and 78 deletions.
14 changes: 7 additions & 7 deletions amf-antlr-syntax/js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion amf-antlr-syntax/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"dependencies": {
"@aml-org/amf-antlr-parsers": "0.7.25",
"ajv": "6.12.6",
"avro-js": "1.12.0"
"avro-js": "1.11.3"
}
}
14 changes: 7 additions & 7 deletions amf-api-contract/js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion amf-api-contract/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"dependencies": {
"@aml-org/amf-antlr-parsers": "0.7.25",
"ajv": "6.12.6",
"avro-js": "^1.12.0"
"avro-js": "1.11.3"
}
}
2 changes: 1 addition & 1 deletion amf-apicontract.versions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
amf.apicontract=5.6.0
amf.apicontract=5.6.1
amf.aml=6.6.0
amf.model=3.9.0
antlr4Version=0.7.25
Expand Down
2 changes: 1 addition & 1 deletion amf-cli/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
"dependencies": {
"@aml-org/amf-antlr-parsers": "0.7.25",
"ajv": "6.12.6",
"avro-js": "1.12.0"
"avro-js": "1.11.3"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Number of results: 1
Level: Violation

- Constraint: http://a.ml/vocabularies/amf/parser#invalid-avro-schema
Message: Invalid type: Unknown schema: org.apache.avro.compiler.UnresolvedSchema
Message: Type not supported: asdfasdf
Severity: Violation
Target: file://amf-cli/shared/src/test/resources/avro/schemas/invalid-avro-type.json#/any/default-any
Property:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Number of results: 1
Level: Violation

- Constraint: http://a.ml/vocabularies/amf/parser#invalid-avro-schema
Message: Invalid type: Unknown schema: org.apache.avro.compiler.UnresolvedSchema
Message: Type not supported: object
Severity: Violation
Target: file://amf-cli/shared/src/test/resources/avro/schemas/wrong-type.json#/any/default-any
Property:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,15 @@ class AvroSchemaValidationTest extends MultiPlatformReportGenTest {
)
}

if (platform.name == "jvm") { // We were able only to change this behavior in JVM validator. JS one is still strict (only letter, numbers and '_')
test("validate record name with special chars") {
validate(
"name-with-special-chars.json",
None,
configOverride = Some(config)
)
}
}
// TODO We need to see how implement this in with AVRO 1.11.3

// if (platform.name == "jvm") { // We were able only to change this behavior in JVM validator. JS one is still strict (only letter, numbers and '_')
// test("validate record name with special chars") {
// validate(
// "name-with-special-chars.json",
// None,
// configOverride = Some(config)
// )
// }
// }
}
14 changes: 7 additions & 7 deletions amf-graphql/js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion amf-graphql/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"dependencies": {
"@aml-org/amf-antlr-parsers": "0.7.25",
"ajv": "6.12.6",
"avro-js": "1.12.0"
"avro-js": "1.11.3"
}
}
14 changes: 7 additions & 7 deletions amf-grpc/js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion amf-grpc/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"dependencies": {
"@aml-org/amf-antlr-parsers": "0.7.25",
"ajv": "6.12.6",
"avro-js": "1.12.0"
"avro-js": "1.11.3"
}
}
14 changes: 7 additions & 7 deletions amf-shapes/js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion amf-shapes/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"dependencies": {
"@aml-org/amf-antlr-parsers": "0.7.25",
"ajv": "6.12.6",
"avro-js": "1.12.0"
"avro-js": "1.11.3"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import amf.shapes.internal.validation.common.ValidationProcessor
import amf.shapes.internal.validation.definitions.ShapePayloadValidations.SchemaException
import org.apache.avro.generic.{GenericDatumReader, GenericRecord}
import org.apache.avro.io.DecoderFactory
import org.apache.avro.{AvroTypeException, NameValidator, Schema, SchemaParseException}
import org.apache.avro.{AvroTypeException, Schema, SchemaParseException}

class JvmAvroShapePayloadValidator(
private val shape: Shape,
Expand All @@ -26,7 +26,7 @@ class JvmAvroShapePayloadValidator(
private val configuration: ShapeValidationConfiguration
) extends BaseAvroSchemaPayloadValidator(shape, mediaType, configuration) {

lazy val parser: Schema.Parser = new Schema.Parser(new CustomNameValidator()).setValidateDefaults(true)
lazy val parser: Schema.Parser = new Schema.Parser().setValidateDefaults(true)

override protected def getReportProcessor(profileName: ProfileName): ValidationProcessor =
JvmReportValidationProcessor(profileName, shape)
Expand Down Expand Up @@ -177,21 +177,3 @@ case class JvmReportValidationProcessor(
processResults(results)
}
}

class CustomNameValidator extends NameValidator {
private val allowedChars = Seq('_', '-', '.')
override def validate(name: String): NameValidator.Result = {
if (name == null) return new NameValidator.Result("Null name")
val length = name.length
if (length == 0) return new NameValidator.Result("Empty name")
val first = name.charAt(0)
if (!(Character.isLetter(first) || first == '_'))
return new NameValidator.Result("Illegal initial character: " + name)
for (i <- 1 until length) {
val c = name.charAt(i)
if (!(Character.isLetterOrDigit(c) || allowedChars.contains(c)))
return new NameValidator.Result("Illegal character in: " + name)
}
NameValidator.OK
}
}
10 changes: 5 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ThisBuild / resolvers ++= List(
ThisBuild / credentials ++= Common.credentials()

val npmDeps =
List(("ajv", "6.12.6"), ("@aml-org/amf-antlr-parsers", versions("antlr4Version")), (("avro-js", "1.12.0")))
List(("ajv", "6.12.6"), ("@aml-org/amf-antlr-parsers", versions("antlr4Version")), (("avro-js", "1.11.3")))

val apiContractModelVersion = settingKey[String]("Version of the AMF API Contract Model").withRank(KeyRanks.Invisible)

Expand Down Expand Up @@ -79,10 +79,10 @@ lazy val shapes = crossProject(JSPlatform, JVMPlatform)
ExclusionRule(organization = "commons-collections", name = "commons-collections"),
ExclusionRule(organization = "com.fasterxml.jackson.core", name = "jackson-databind"),
),
libraryDependencies += "org.apache.avro" % "avro" % "1.12.0",
libraryDependencies += "org.json" % "json" % "20231013",
libraryDependencies += "org.apache.commons" % "commons-collections4" % "4.4",
Compile / packageDoc / artifactPath := baseDirectory.value / "target" / "artifact" / "amf-shapes-javadoc.jar"
libraryDependencies += "org.apache.avro" % "avro" % "1.11.3",
libraryDependencies += "org.json" % "json" % "20231013",
libraryDependencies += "org.apache.commons" % "commons-collections4" % "4.4",
Compile / packageDoc / artifactPath := baseDirectory.value / "target" / "artifact" / "amf-shapes-javadoc.jar"
)
.jsSettings(
scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.CommonJSModule) },
Expand Down

0 comments on commit cd063dc

Please sign in to comment.