Skip to content

Commit

Permalink
Merge pull request #1070 from aml-org/r/v6.3.2
Browse files Browse the repository at this point in the history
R/v6.3.2
  • Loading branch information
emilianoascona authored Sep 26, 2024
2 parents edbbe7b + bec1933 commit 1f21933
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import amf.core.internal.remote.Spec.{AMF, GRAPHQL}
import amf.core.internal.remote.{AmlDialectSpec, Spec}
import amf.graphql.client.scala.GraphQLConfiguration
import amf.shapes.client.scala.config.JsonSchemaConfiguration
import amf.shapes.client.scala.model.document.{AvroSchemaDocument, JsonSchemaDocument}
import amf.shapes.client.scala.model.document.JsonSchemaDocument
import amf.shapes.client.scala.model.domain.AnyShape
import amf.shapes.client.scala.render.JsonSchemaShapeRenderer
import org.mulesoft.als.configuration.{MaxSizeCounter, MaxSizeException, MaxSizeResourceLoader}
import org.mulesoft.als.configuration.{MaxSizeCounter, MaxSizeResourceLoader}
import org.mulesoft.amfintegration.AmfImplicits._
import org.mulesoft.amfintegration.ValidationProfile
import org.mulesoft.amfintegration.dialect.dialects.ExternalFragmentDialect
Expand Down Expand Up @@ -74,6 +74,7 @@ case class ALSConfigurationState(
case Spec.ASYNC26 => Some(AsyncAPIConfiguration.Async20())
case Spec.GRAPHQL => Some(ConfigurationAdapter.adapt(GraphQLConfiguration.GraphQL()))
case Spec.JSONSCHEMA => Some(ConfigurationAdapter.adapt(JsonSchemaConfiguration.JsonSchema()))
case Spec.AVRO_SCHEMA => Some(AvroConfiguration.Avro())
case _ if spec.isAsync => Some(AsyncAPIConfiguration.Async20())
case _ => None
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"type": "record",
"name": "Person",
"fields": [
{"name": "name", "type": "string", "example": "Donkey"},
{"name": "age", "type": ["null", "int"], "default": null},
{
"name": "favoriteProgrammingLanguage",
"type": {"name": "ProgrammingLanguage", "type": "enum", "symbols": ["JS", "Java", "Go", "Rust", "C"]}
},
{
"name": "address",
"type": {
"name": "Address",
"type": "record",
"fields": [{"name": "zipcode", "type": "int"}]
}
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,21 @@ class BasicCleanDiagnosticTest extends LanguageServerBaseTest {
}
}
}

test("Avro with only one error") {
withServer(buildServer()) { server =>
for {
d <- requestCleanDiagnostic(server)(filePath("avro/union-type-payload-error.avsc"))
} yield {
server.shutdown()
assert(d.size == 1)
assert(d.head.diagnostics.isEmpty)
assert(d.head.profile == ProfileNames.AVROSCHEMA)
}
}
}


def buildServer(): LanguageServer = {
val diagnosticNotifier = new MockDiagnosticClientNotifier()
val builder = new WorkspaceManagerFactoryBuilder(diagnosticNotifier)
Expand Down
4 changes: 2 additions & 2 deletions dependencies.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version=6.3.1
amf=5.6.1
version=6.3.2
amf=5.6.2
amf.custom-validator.js=1.7.2
amf.custom-validator-scalajs=0.6.0
amf-antlr-parsers=0.7.25

0 comments on commit 1f21933

Please sign in to comment.