From de5b893d5717937cf349ffb88df415002164dd51 Mon Sep 17 00:00:00 2001 From: Lele <45210281+llibarona@users.noreply.github.com> Date: Tue, 1 Oct 2024 01:26:23 -0300 Subject: [PATCH 01/10] W-16814887: avro map values is now expecting a scalar (will not add and eol after suggestion) (#1071) --- .../amfintegration/dialect/dialects/avro/AvroDialect.scala | 2 +- .../root-from-avro/map/expected/root.yaml.json | 4 ++-- .../test/avro/by-directory/root/map/expected/root.avsc.json | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/als-common/shared/src/main/scala/org/mulesoft/amfintegration/dialect/dialects/avro/AvroDialect.scala b/als-common/shared/src/main/scala/org/mulesoft/amfintegration/dialect/dialects/avro/AvroDialect.scala index 27f647a21..91f809272 100644 --- a/als-common/shared/src/main/scala/org/mulesoft/amfintegration/dialect/dialects/avro/AvroDialect.scala +++ b/als-common/shared/src/main/scala/org/mulesoft/amfintegration/dialect/dialects/avro/AvroDialect.scala @@ -196,7 +196,7 @@ object AvroMapNode extends AvroTypedNode { .withEnum( AvroDialect.avroTypes ) - .withObjectRange(Seq(AvroRootNode.id)) + .withLiteralRange(xsdString.iri()) } object AvroArrayNode extends AvroTypedNode { diff --git a/als-suggestions/shared/src/test/resources/test/async26/by-directory/WIP-AVRO/OKBUTDUPLICATES/root-from-avro/map/expected/root.yaml.json b/als-suggestions/shared/src/test/resources/test/async26/by-directory/WIP-AVRO/OKBUTDUPLICATES/root-from-avro/map/expected/root.yaml.json index 5c690f603..7946963fd 100644 --- a/als-suggestions/shared/src/test/resources/test/async26/by-directory/WIP-AVRO/OKBUTDUPLICATES/root-from-avro/map/expected/root.yaml.json +++ b/als-suggestions/shared/src/test/resources/test/async26/by-directory/WIP-AVRO/OKBUTDUPLICATES/root-from-avro/map/expected/root.yaml.json @@ -121,7 +121,7 @@ ], "sortText": "11values", - "filterText": "values:\n ", + "filterText": "values: ", "insertText": null, "insertTextFormat": [ 1 @@ -137,7 +137,7 @@ "character": 10 } }, - "newText": "values:\n " + "newText": "values: " }, "additionalTextEdits": null, "commitCharacters": null, diff --git a/als-suggestions/shared/src/test/resources/test/avro/by-directory/root/map/expected/root.avsc.json b/als-suggestions/shared/src/test/resources/test/avro/by-directory/root/map/expected/root.avsc.json index edd2105d2..01830736b 100644 --- a/als-suggestions/shared/src/test/resources/test/avro/by-directory/root/map/expected/root.avsc.json +++ b/als-suggestions/shared/src/test/resources/test/avro/by-directory/root/map/expected/root.avsc.json @@ -121,7 +121,7 @@ ], "sortText": "11values", - "filterText": "\"values\": {\n \"$1\"\n}", + "filterText": "\"values\": \"$1\"", "insertText": null, "insertTextFormat": [ 2 @@ -137,7 +137,7 @@ "character": 4 } }, - "newText": "\"values\": {\n \"$1\"\n}" + "newText": "\"values\": \"$1\"" }, "additionalTextEdits": null, "commitCharacters": null, From c963f197755f3e0db4fef01986ab818fd1496872 Mon Sep 17 00:00:00 2001 From: Lele <45210281+llibarona@users.noreply.github.com> Date: Tue, 1 Oct 2024 14:11:58 -0300 Subject: [PATCH 02/10] W-16814386: fix suggestions inside fields when a more precise type is declared (#1072) --- .../avroschema/structure/ResolveField.scala | 4 +- .../expected/nested-fields.yaml.json | 254 ++++++++++++++++++ .../WIP-AVRO/nested-fields/nested-fields.yaml | 13 + 3 files changed, 270 insertions(+), 1 deletion(-) create mode 100644 als-suggestions/shared/src/test/resources/test/async26/by-directory/WIP-AVRO/nested-fields/expected/nested-fields.yaml.json create mode 100644 als-suggestions/shared/src/test/resources/test/async26/by-directory/WIP-AVRO/nested-fields/nested-fields.yaml diff --git a/als-suggestions/shared/src/main/scala/org/mulesoft/als/suggestions/plugins/aml/webapi/avroschema/structure/ResolveField.scala b/als-suggestions/shared/src/main/scala/org/mulesoft/als/suggestions/plugins/aml/webapi/avroschema/structure/ResolveField.scala index 9e07806e7..309416cad 100644 --- a/als-suggestions/shared/src/main/scala/org/mulesoft/als/suggestions/plugins/aml/webapi/avroschema/structure/ResolveField.scala +++ b/als-suggestions/shared/src/main/scala/org/mulesoft/als/suggestions/plugins/aml/webapi/avroschema/structure/ResolveField.scala @@ -15,13 +15,15 @@ import scala.concurrent.Future object ResolveField extends ResolveIfApplies { override def resolve(request: AmlCompletionRequest): Option[Future[Seq[RawSuggestion]]] = { request.amfObject match { - case _: AnyShape if isField(request) => + case _: AnyShape if isField(request) && !newerTypeDefined(request) => applies(fieldNodeSuggestions(request.actualDialect)) case _ => notApply } } + private def newerTypeDefined(request: AmlCompletionRequest) = request.amfObject.annotations.avroSchemaType().isDefined + private def isField(request: AmlCompletionRequest) = request.astPartBranch.parentEntryIs("fields") && request.branchStack.tail.headOption diff --git a/als-suggestions/shared/src/test/resources/test/async26/by-directory/WIP-AVRO/nested-fields/expected/nested-fields.yaml.json b/als-suggestions/shared/src/test/resources/test/async26/by-directory/WIP-AVRO/nested-fields/expected/nested-fields.yaml.json new file mode 100644 index 000000000..3675b8342 --- /dev/null +++ b/als-suggestions/shared/src/test/resources/test/async26/by-directory/WIP-AVRO/nested-fields/expected/nested-fields.yaml.json @@ -0,0 +1,254 @@ +[ + { + "label": "New fields", + "kind": [ + + ], + "detail": "template", + "documentation": "fields", + "deprecated": [ + + ], + "preselect": [ + + ], + "sortText": "21New fields", + "filterText": "fields:\n -\n name: $1\n type: $2", + "insertText": null, + "insertTextFormat": [ + 2 + ], + "textEdit": { + "range": { + "start": { + "line": 12, + "character": 14 + }, + "end": { + "line": 12, + "character": 14 + } + }, + "newText": "fields:\n -\n name: $1\n type: $2" + }, + "additionalTextEdits": null, + "commitCharacters": null, + "command": null + }, + { + "label": "aliases", + "kind": [ + + ], + "detail": "unknown", + "documentation": "aliases", + "deprecated": [ + + ], + "preselect": [ + + ], + "sortText": "11aliases", + "filterText": "aliases:\n - ", + "insertText": null, + "insertTextFormat": [ + 1 + ], + "textEdit": { + "range": { + "start": { + "line": 12, + "character": 14 + }, + "end": { + "line": 12, + "character": 14 + } + }, + "newText": "aliases:\n - " + }, + "additionalTextEdits": null, + "commitCharacters": null, + "command": null + }, + { + "label": "default", + "kind": [ + + ], + "detail": "parameters", + "documentation": "default", + "deprecated": [ + + ], + "preselect": [ + + ], + "sortText": "11default", + "filterText": "default: ", + "insertText": null, + "insertTextFormat": [ + 1 + ], + "textEdit": { + "range": { + "start": { + "line": 12, + "character": 14 + }, + "end": { + "line": 12, + "character": 14 + } + }, + "newText": "default: " + }, + "additionalTextEdits": null, + "commitCharacters": null, + "command": null + }, + { + "label": "doc", + "kind": [ + + ], + "detail": "unknown", + "documentation": "doc", + "deprecated": [ + + ], + "preselect": [ + + ], + "sortText": "11doc", + "filterText": "doc: ", + "insertText": null, + "insertTextFormat": [ + 1 + ], + "textEdit": { + "range": { + "start": { + "line": 12, + "character": 14 + }, + "end": { + "line": 12, + "character": 14 + } + }, + "newText": "doc: " + }, + "additionalTextEdits": null, + "commitCharacters": null, + "command": null + }, + { + "label": "fields", + "kind": [ + + ], + "detail": "unknown", + "documentation": "fields", + "deprecated": [ + + ], + "preselect": [ + + ], + "sortText": "11fields", + "filterText": "fields:\n - ", + "insertText": null, + "insertTextFormat": [ + 1 + ], + "textEdit": { + "range": { + "start": { + "line": 12, + "character": 14 + }, + "end": { + "line": 12, + "character": 14 + } + }, + "newText": "fields:\n - " + }, + "additionalTextEdits": null, + "commitCharacters": null, + "command": null + }, + { + "label": "logicalType", + "kind": [ + + ], + "detail": "unknown", + "documentation": "logicalType", + "deprecated": [ + + ], + "preselect": [ + + ], + "sortText": "11logicalType", + "filterText": "logicalType: ", + "insertText": null, + "insertTextFormat": [ + 1 + ], + "textEdit": { + "range": { + "start": { + "line": 12, + "character": 14 + }, + "end": { + "line": 12, + "character": 14 + } + }, + "newText": "logicalType: " + }, + "additionalTextEdits": null, + "commitCharacters": null, + "command": null + }, + { + "label": "namespace", + "kind": [ + + ], + "detail": "unknown", + "documentation": "namespace", + "deprecated": [ + + ], + "preselect": [ + + ], + "sortText": "11namespace", + "filterText": "namespace: ", + "insertText": null, + "insertTextFormat": [ + 1 + ], + "textEdit": { + "range": { + "start": { + "line": 12, + "character": 14 + }, + "end": { + "line": 12, + "character": 14 + } + }, + "newText": "namespace: " + }, + "additionalTextEdits": null, + "commitCharacters": null, + "command": null + } +] \ No newline at end of file diff --git a/als-suggestions/shared/src/test/resources/test/async26/by-directory/WIP-AVRO/nested-fields/nested-fields.yaml b/als-suggestions/shared/src/test/resources/test/async26/by-directory/WIP-AVRO/nested-fields/nested-fields.yaml new file mode 100644 index 000000000..3f5239df1 --- /dev/null +++ b/als-suggestions/shared/src/test/resources/test/async26/by-directory/WIP-AVRO/nested-fields/nested-fields.yaml @@ -0,0 +1,13 @@ +asyncapi: '2.6.0' +channels: + myChannel: + publish: + message: + schemaFormat: application/vnd.apache.avro;version=1.9.0 + payload: + type: record + name: testNested + fields: + - name: sd + type: record + * \ No newline at end of file From 94e0c8c6e99d6ef3cdfe55d3ffab5c4765adb6a7 Mon Sep 17 00:00:00 2001 From: Lele <45210281+llibarona@users.noreply.github.com> Date: Thu, 3 Oct 2024 13:34:16 -0300 Subject: [PATCH 03/10] W-16814742: add test for previous bug with duplicated suggestions under items in an avro record inside async 2.6 (#1073) --- .../duplicated-items/duplicated-items.yaml | 13 + .../expected/duplicated-items.yaml.json | 470 ++++++++++++++++++ 2 files changed, 483 insertions(+) create mode 100644 als-suggestions/shared/src/test/resources/test/async26/by-directory/WIP-AVRO/duplicated-items/duplicated-items.yaml create mode 100644 als-suggestions/shared/src/test/resources/test/async26/by-directory/WIP-AVRO/duplicated-items/expected/duplicated-items.yaml.json diff --git a/als-suggestions/shared/src/test/resources/test/async26/by-directory/WIP-AVRO/duplicated-items/duplicated-items.yaml b/als-suggestions/shared/src/test/resources/test/async26/by-directory/WIP-AVRO/duplicated-items/duplicated-items.yaml new file mode 100644 index 000000000..99f118687 --- /dev/null +++ b/als-suggestions/shared/src/test/resources/test/async26/by-directory/WIP-AVRO/duplicated-items/duplicated-items.yaml @@ -0,0 +1,13 @@ +asyncapi: '2.6.0' +channels: + myChannel: + publish: + message: + schemaFormat: application/vnd.apache.avro;version=1.9.0 + payload: + type: record + name: LongList + fields: + - name: ListArray + type: array + items: * \ No newline at end of file diff --git a/als-suggestions/shared/src/test/resources/test/async26/by-directory/WIP-AVRO/duplicated-items/expected/duplicated-items.yaml.json b/als-suggestions/shared/src/test/resources/test/async26/by-directory/WIP-AVRO/duplicated-items/expected/duplicated-items.yaml.json new file mode 100644 index 000000000..39bf47f98 --- /dev/null +++ b/als-suggestions/shared/src/test/resources/test/async26/by-directory/WIP-AVRO/duplicated-items/expected/duplicated-items.yaml.json @@ -0,0 +1,470 @@ +[ + { + "label": "array", + "kind": [ + + ], + "detail": "unknown", + "documentation": "array", + "deprecated": [ + + ], + "preselect": [ + + ], + "sortText": "11array", + "filterText": "array", + "insertText": null, + "insertTextFormat": [ + 1 + ], + "textEdit": { + "range": { + "start": { + "line": 12, + "character": 21 + }, + "end": { + "line": 12, + "character": 21 + } + }, + "newText": "array" + }, + "additionalTextEdits": null, + "commitCharacters": null, + "command": null + }, + { + "label": "boolean", + "kind": [ + + ], + "detail": "unknown", + "documentation": "boolean", + "deprecated": [ + + ], + "preselect": [ + + ], + "sortText": "11boolean", + "filterText": "boolean", + "insertText": null, + "insertTextFormat": [ + 1 + ], + "textEdit": { + "range": { + "start": { + "line": 12, + "character": 21 + }, + "end": { + "line": 12, + "character": 21 + } + }, + "newText": "boolean" + }, + "additionalTextEdits": null, + "commitCharacters": null, + "command": null + }, + { + "label": "bytes", + "kind": [ + + ], + "detail": "unknown", + "documentation": "bytes", + "deprecated": [ + + ], + "preselect": [ + + ], + "sortText": "11bytes", + "filterText": "bytes", + "insertText": null, + "insertTextFormat": [ + 1 + ], + "textEdit": { + "range": { + "start": { + "line": 12, + "character": 21 + }, + "end": { + "line": 12, + "character": 21 + } + }, + "newText": "bytes" + }, + "additionalTextEdits": null, + "commitCharacters": null, + "command": null + }, + { + "label": "double", + "kind": [ + + ], + "detail": "unknown", + "documentation": "double", + "deprecated": [ + + ], + "preselect": [ + + ], + "sortText": "11double", + "filterText": "double", + "insertText": null, + "insertTextFormat": [ + 1 + ], + "textEdit": { + "range": { + "start": { + "line": 12, + "character": 21 + }, + "end": { + "line": 12, + "character": 21 + } + }, + "newText": "double" + }, + "additionalTextEdits": null, + "commitCharacters": null, + "command": null + }, + { + "label": "enum", + "kind": [ + + ], + "detail": "unknown", + "documentation": "enum", + "deprecated": [ + + ], + "preselect": [ + + ], + "sortText": "11enum", + "filterText": "enum", + "insertText": null, + "insertTextFormat": [ + 1 + ], + "textEdit": { + "range": { + "start": { + "line": 12, + "character": 21 + }, + "end": { + "line": 12, + "character": 21 + } + }, + "newText": "enum" + }, + "additionalTextEdits": null, + "commitCharacters": null, + "command": null + }, + { + "label": "fixed", + "kind": [ + + ], + "detail": "unknown", + "documentation": "fixed", + "deprecated": [ + + ], + "preselect": [ + + ], + "sortText": "11fixed", + "filterText": "fixed", + "insertText": null, + "insertTextFormat": [ + 1 + ], + "textEdit": { + "range": { + "start": { + "line": 12, + "character": 21 + }, + "end": { + "line": 12, + "character": 21 + } + }, + "newText": "fixed" + }, + "additionalTextEdits": null, + "commitCharacters": null, + "command": null + }, + { + "label": "float", + "kind": [ + + ], + "detail": "unknown", + "documentation": "float", + "deprecated": [ + + ], + "preselect": [ + + ], + "sortText": "11float", + "filterText": "float", + "insertText": null, + "insertTextFormat": [ + 1 + ], + "textEdit": { + "range": { + "start": { + "line": 12, + "character": 21 + }, + "end": { + "line": 12, + "character": 21 + } + }, + "newText": "float" + }, + "additionalTextEdits": null, + "commitCharacters": null, + "command": null + }, + { + "label": "int", + "kind": [ + + ], + "detail": "unknown", + "documentation": "int", + "deprecated": [ + + ], + "preselect": [ + + ], + "sortText": "11int", + "filterText": "int", + "insertText": null, + "insertTextFormat": [ + 1 + ], + "textEdit": { + "range": { + "start": { + "line": 12, + "character": 21 + }, + "end": { + "line": 12, + "character": 21 + } + }, + "newText": "int" + }, + "additionalTextEdits": null, + "commitCharacters": null, + "command": null + }, + { + "label": "long", + "kind": [ + + ], + "detail": "unknown", + "documentation": "long", + "deprecated": [ + + ], + "preselect": [ + + ], + "sortText": "11long", + "filterText": "long", + "insertText": null, + "insertTextFormat": [ + 1 + ], + "textEdit": { + "range": { + "start": { + "line": 12, + "character": 21 + }, + "end": { + "line": 12, + "character": 21 + } + }, + "newText": "long" + }, + "additionalTextEdits": null, + "commitCharacters": null, + "command": null + }, + { + "label": "map", + "kind": [ + + ], + "detail": "unknown", + "documentation": "map", + "deprecated": [ + + ], + "preselect": [ + + ], + "sortText": "11map", + "filterText": "map", + "insertText": null, + "insertTextFormat": [ + 1 + ], + "textEdit": { + "range": { + "start": { + "line": 12, + "character": 21 + }, + "end": { + "line": 12, + "character": 21 + } + }, + "newText": "map" + }, + "additionalTextEdits": null, + "commitCharacters": null, + "command": null + }, + { + "label": "null", + "kind": [ + + ], + "detail": "unknown", + "documentation": "null", + "deprecated": [ + + ], + "preselect": [ + + ], + "sortText": "11null", + "filterText": "\"null\"", + "insertText": null, + "insertTextFormat": [ + 1 + ], + "textEdit": { + "range": { + "start": { + "line": 12, + "character": 21 + }, + "end": { + "line": 12, + "character": 21 + } + }, + "newText": "\"null\"" + }, + "additionalTextEdits": null, + "commitCharacters": null, + "command": null + }, + { + "label": "record", + "kind": [ + + ], + "detail": "unknown", + "documentation": "record", + "deprecated": [ + + ], + "preselect": [ + + ], + "sortText": "11record", + "filterText": "record", + "insertText": null, + "insertTextFormat": [ + 1 + ], + "textEdit": { + "range": { + "start": { + "line": 12, + "character": 21 + }, + "end": { + "line": 12, + "character": 21 + } + }, + "newText": "record" + }, + "additionalTextEdits": null, + "commitCharacters": null, + "command": null + }, + { + "label": "string", + "kind": [ + + ], + "detail": "unknown", + "documentation": "string", + "deprecated": [ + + ], + "preselect": [ + + ], + "sortText": "11string", + "filterText": "string", + "insertText": null, + "insertTextFormat": [ + 1 + ], + "textEdit": { + "range": { + "start": { + "line": 12, + "character": 21 + }, + "end": { + "line": 12, + "character": 21 + } + }, + "newText": "string" + }, + "additionalTextEdits": null, + "commitCharacters": null, + "command": null + } +] \ No newline at end of file From 14340b1ea1e2f4acdbc387c4df1afaa4308737c5 Mon Sep 17 00:00:00 2001 From: emilianoascona <39959392+emilianoascona@users.noreply.github.com> Date: Fri, 4 Oct 2024 10:37:33 -0300 Subject: [PATCH 04/10] [W-16595822] Fix suggestions on array inside servers node (#1074) --- .../AsyncApiCompletionPluginRegistry.scala | 1 + .../aml/AMLStructureCompletionPlugin.scala | 1 - .../webapi/async/Async2ExceptionPlugins.scala | 7 ++++- .../async/Async2ServerExceptionPlugin.scala | 29 +++++++++++++++++++ .../aml/webapi/async/AsyncApi20RefTag.scala | 1 - .../servers-inside-array-one-server.yaml.json | 3 ++ .../servers-inside-array-one-server.yaml | 21 ++++++++++++++ 7 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 als-suggestions/shared/src/main/scala/org/mulesoft/als/suggestions/plugins/aml/webapi/async/Async2ServerExceptionPlugin.scala create mode 100644 als-suggestions/shared/src/test/resources/test/async26/by-directory/channel/expected/servers-inside-array-one-server.yaml.json create mode 100644 als-suggestions/shared/src/test/resources/test/async26/by-directory/channel/servers-inside-array-one-server.yaml diff --git a/als-suggestions/shared/src/main/scala/org/mulesoft/als/suggestions/aml/webapi/AsyncApiCompletionPluginRegistry.scala b/als-suggestions/shared/src/main/scala/org/mulesoft/als/suggestions/aml/webapi/AsyncApiCompletionPluginRegistry.scala index 77a495845..2f76d5503 100644 --- a/als-suggestions/shared/src/main/scala/org/mulesoft/als/suggestions/aml/webapi/AsyncApiCompletionPluginRegistry.scala +++ b/als-suggestions/shared/src/main/scala/org/mulesoft/als/suggestions/aml/webapi/AsyncApiCompletionPluginRegistry.scala @@ -38,6 +38,7 @@ trait AsyncApiCompletionPluginRegistry extends WebApiCompletionPluginRegistry { ResolveInfo, AsyncApiVariableValueException, Async2HeadersSchema, + ServerResolver, ResolveDefault ) ) :+ diff --git a/als-suggestions/shared/src/main/scala/org/mulesoft/als/suggestions/plugins/aml/AMLStructureCompletionPlugin.scala b/als-suggestions/shared/src/main/scala/org/mulesoft/als/suggestions/plugins/aml/AMLStructureCompletionPlugin.scala index 2fe022d40..23ce9b014 100644 --- a/als-suggestions/shared/src/main/scala/org/mulesoft/als/suggestions/plugins/aml/AMLStructureCompletionPlugin.scala +++ b/als-suggestions/shared/src/main/scala/org/mulesoft/als/suggestions/plugins/aml/AMLStructureCompletionPlugin.scala @@ -2,7 +2,6 @@ package org.mulesoft.als.suggestions.plugins.aml import amf.aml.client.scala.model.document.Dialect import amf.aml.client.scala.model.domain.{NodeMapping, PropertyMapping} -import amf.apicontract.client.scala.model.domain.{Payload, Response} import amf.core.client.scala.model.document.Module import amf.core.internal.metamodel.Field import amf.core.internal.metamodel.Type.ArrayLike diff --git a/als-suggestions/shared/src/main/scala/org/mulesoft/als/suggestions/plugins/aml/webapi/async/Async2ExceptionPlugins.scala b/als-suggestions/shared/src/main/scala/org/mulesoft/als/suggestions/plugins/aml/webapi/async/Async2ExceptionPlugins.scala index 556afe649..cdedf28a0 100644 --- a/als-suggestions/shared/src/main/scala/org/mulesoft/als/suggestions/plugins/aml/webapi/async/Async2ExceptionPlugins.scala +++ b/als-suggestions/shared/src/main/scala/org/mulesoft/als/suggestions/plugins/aml/webapi/async/Async2ExceptionPlugins.scala @@ -12,5 +12,10 @@ object Async2ExceptionPlugins { def applyAny(request: AmlCompletionRequest): Boolean = exceptions.exists(_.applies(request)) private val exceptions: Seq[ExceptionPlugin] = - Seq(AsyncApi20BindingsCompletionPlugin, AsyncApi26BindingsCompletionPlugin, Async2VariableValueParam) + Seq( + AsyncApi20BindingsCompletionPlugin, + AsyncApi26BindingsCompletionPlugin, + Async2VariableValueParam, + Async2ServerExceptionPlugin + ) } diff --git a/als-suggestions/shared/src/main/scala/org/mulesoft/als/suggestions/plugins/aml/webapi/async/Async2ServerExceptionPlugin.scala b/als-suggestions/shared/src/main/scala/org/mulesoft/als/suggestions/plugins/aml/webapi/async/Async2ServerExceptionPlugin.scala new file mode 100644 index 000000000..d7b76231f --- /dev/null +++ b/als-suggestions/shared/src/main/scala/org/mulesoft/als/suggestions/plugins/aml/webapi/async/Async2ServerExceptionPlugin.scala @@ -0,0 +1,29 @@ +package org.mulesoft.als.suggestions.plugins.aml.webapi.async + +import amf.apicontract.client.scala.model.domain.{EndPoint, Server} +import org.mulesoft.als.suggestions.RawSuggestion +import org.mulesoft.als.suggestions.aml.AmlCompletionRequest +import org.mulesoft.als.suggestions.interfaces.ResolveIfApplies +import org.mulesoft.als.suggestions.plugins.aml.webapi.ExceptionPlugin + +import scala.concurrent.Future + +object Async2ServerExceptionPlugin extends ExceptionPlugin with AsyncEndpointServerIdentifier { + override def id: String = "ServerExceptionPlugin" + + override def applies(request: AmlCompletionRequest): Boolean = + isServerFromEndpoint(request) + + override def resolve(request: AmlCompletionRequest): Future[Seq[RawSuggestion]] = emptySuggestion +} + +object ServerResolver extends ResolveIfApplies with AsyncEndpointServerIdentifier { + override def resolve(request: AmlCompletionRequest): Option[Future[Seq[RawSuggestion]]] = + if (isServerFromEndpoint(request)) Some(Future.successful(Seq.empty)) else None +} + +trait AsyncEndpointServerIdentifier { + def isServerFromEndpoint(request: AmlCompletionRequest): Boolean = + request.amfObject.isInstanceOf[Server] && + request.branchStack.headOption.exists(_.isInstanceOf[EndPoint]) +} diff --git a/als-suggestions/shared/src/main/scala/org/mulesoft/als/suggestions/plugins/aml/webapi/async/AsyncApi20RefTag.scala b/als-suggestions/shared/src/main/scala/org/mulesoft/als/suggestions/plugins/aml/webapi/async/AsyncApi20RefTag.scala index 7196fdd1b..8393fa82e 100644 --- a/als-suggestions/shared/src/main/scala/org/mulesoft/als/suggestions/plugins/aml/webapi/async/AsyncApi20RefTag.scala +++ b/als-suggestions/shared/src/main/scala/org/mulesoft/als/suggestions/plugins/aml/webapi/async/AsyncApi20RefTag.scala @@ -11,7 +11,6 @@ import scala.concurrent.Future object AsyncApi20RefTag extends AMLRefTagCompletionPlugin with IsInsideRequired with Async2PayloadExampleMatcher { - // hack for bindings, has the K: will be a dynamic name. Also, when the refactor of syaml is done, is method should still works (as we will at an empty map?) override protected def isObjectDeclarable(params: AmlCompletionRequest): Boolean = super.isObjectDeclarable(params) diff --git a/als-suggestions/shared/src/test/resources/test/async26/by-directory/channel/expected/servers-inside-array-one-server.yaml.json b/als-suggestions/shared/src/test/resources/test/async26/by-directory/channel/expected/servers-inside-array-one-server.yaml.json new file mode 100644 index 000000000..c9c513b9b --- /dev/null +++ b/als-suggestions/shared/src/test/resources/test/async26/by-directory/channel/expected/servers-inside-array-one-server.yaml.json @@ -0,0 +1,3 @@ +[ + +] \ No newline at end of file diff --git a/als-suggestions/shared/src/test/resources/test/async26/by-directory/channel/servers-inside-array-one-server.yaml b/als-suggestions/shared/src/test/resources/test/async26/by-directory/channel/servers-inside-array-one-server.yaml new file mode 100644 index 000000000..481b5cc92 --- /dev/null +++ b/als-suggestions/shared/src/test/resources/test/async26/by-directory/channel/servers-inside-array-one-server.yaml @@ -0,0 +1,21 @@ +asyncapi: 2.6.0 +info: + title: Async 2.2 new fields + version: 1.0.0 + description: Async 2.2 new fields +servers: + myServer: + url: some.com + protocol: ibmmq + bindings: + ibmmq: + groupId: test + ccdtQueueManagerName: test + cipherSpec: test + multiEndpointServer: true + heartBeatInterval: 123 +channels: + myChannel: + servers: + - myServer + * From cdc1e74a6a74a0ecdd97b770672e937929f66146 Mon Sep 17 00:00:00 2001 From: emilianoascona <39959392+emilianoascona@users.noreply.github.com> Date: Mon, 7 Oct 2024 15:51:14 -0300 Subject: [PATCH 05/10] Add missing dialect in validation (#1076) Fix suggestions inside json nodes --- .../aml/AMLRefTagCompletionPlugin.scala | 13 +------ .../async26-json/by-directory/schemas.json | 2 +- .../definitions/if/expected/inside.json.json | 36 +++++++++++++++++++ .../properties/expected/inside.json.json | 36 +++++++++++++++++++ .../properties/expected/inside.json.json | 36 +++++++++++++++++++ .../properties/expected/inside.json.json | 36 +++++++++++++++++++ .../by-directory/if/expected/inside.json.json | 36 +++++++++++++++++++ .../definitions/if/expected/inside.json.json | 36 +++++++++++++++++++ .../properties/expected/inside.json.json | 36 +++++++++++++++++++ .../properties/expected/inside.json.json | 36 +++++++++++++++++++ 10 files changed, 290 insertions(+), 13 deletions(-) diff --git a/als-suggestions/shared/src/main/scala/org/mulesoft/als/suggestions/plugins/aml/AMLRefTagCompletionPlugin.scala b/als-suggestions/shared/src/main/scala/org/mulesoft/als/suggestions/plugins/aml/AMLRefTagCompletionPlugin.scala index e4d8e429e..a66d65f6f 100644 --- a/als-suggestions/shared/src/main/scala/org/mulesoft/als/suggestions/plugins/aml/AMLRefTagCompletionPlugin.scala +++ b/als-suggestions/shared/src/main/scala/org/mulesoft/als/suggestions/plugins/aml/AMLRefTagCompletionPlugin.scala @@ -8,6 +8,7 @@ import org.mulesoft.als.suggestions.interfaces.AMLCompletionPlugin import org.mulesoft.als.suggestions.{PlainText, RawSuggestion, SuggestionStructure} import org.mulesoft.amfintegration.AmfImplicits._ import org.mulesoft.amfintegration.dialect.dialects.asyncapi20.AsyncApi20Dialect +import org.mulesoft.amfintegration.dialect.dialects.asyncapi26.AsyncApi26Dialect import scala.concurrent.ExecutionContext.Implicits.global import scala.concurrent.Future @@ -56,22 +57,10 @@ trait AMLRefTagCompletionPlugin extends AMLCompletionPlugin { (!yPartBranch.hasIncludeTag) && yPartBranch.brothers.isEmpty && isDeclarable(params) && isInFacet(params) && - matchPrefixPatched(params) && !isExceptionCase(yPartBranch) case _ => false } - private def matchPrefixPatched(params: AmlCompletionRequest) = - params.astPartBranch.stringValue.isEmpty || - isEmptyJsonValue(params) || - params.astPartBranch.isArray || - params.astPartBranch.stringValue.startsWith("$") - - private def isEmptyJsonValue(params: AmlCompletionRequest) = - params.actualDialect.id.equals(AsyncApi20Dialect.DialectLocation) && - params.baseUnit.id.endsWith(".json") && - params.astPartBranch.stringValue.equals("{}") - private def isInFacet(params: AmlCompletionRequest): Boolean = isKeyAlone(params) private def isKeyAlone(params: AmlCompletionRequest): Boolean = diff --git a/als-suggestions/shared/src/test/resources/test/async26-json/by-directory/schemas.json b/als-suggestions/shared/src/test/resources/test/async26-json/by-directory/schemas.json index 45fa20768..abe769748 100644 --- a/als-suggestions/shared/src/test/resources/test/async26-json/by-directory/schemas.json +++ b/als-suggestions/shared/src/test/resources/test/async26-json/by-directory/schemas.json @@ -1,5 +1,5 @@ { - "asyncapi": "2.0.0", + "asyncapi": "2.6.0", "info": { "title": "asyncjsonmac", "version": "1.0.0" diff --git a/als-suggestions/shared/src/test/resources/test/jsonschema/draft2019/by-directory/definitions/if/expected/inside.json.json b/als-suggestions/shared/src/test/resources/test/jsonschema/draft2019/by-directory/definitions/if/expected/inside.json.json index 8a1b7fd9f..3b0705ecb 100644 --- a/als-suggestions/shared/src/test/resources/test/jsonschema/draft2019/by-directory/definitions/if/expected/inside.json.json +++ b/als-suggestions/shared/src/test/resources/test/jsonschema/draft2019/by-directory/definitions/if/expected/inside.json.json @@ -71,6 +71,42 @@ "commitCharacters": null, "command": null }, + { + "label": "$ref", + "kind": [ + + ], + "detail": "unknown", + "documentation": "reference tag", + "deprecated": [ + + ], + "preselect": [ + + ], + "sortText": "0$ref", + "filterText": "\"\\$ref\": \"$1\"", + "insertText": null, + "insertTextFormat": [ + 2 + ], + "textEdit": { + "range": { + "start": { + "line": 15, + "character": 38 + }, + "end": { + "line": 15, + "character": 38 + } + }, + "newText": "\"\\$ref\": \"$1\"" + }, + "additionalTextEdits": null, + "commitCharacters": null, + "command": null + }, { "label": "allOf", "kind": [ diff --git a/als-suggestions/shared/src/test/resources/test/jsonschema/draft2019/by-directory/definitions/properties/expected/inside.json.json b/als-suggestions/shared/src/test/resources/test/jsonschema/draft2019/by-directory/definitions/properties/expected/inside.json.json index bc5b4b8cc..42c680abe 100644 --- a/als-suggestions/shared/src/test/resources/test/jsonschema/draft2019/by-directory/definitions/properties/expected/inside.json.json +++ b/als-suggestions/shared/src/test/resources/test/jsonschema/draft2019/by-directory/definitions/properties/expected/inside.json.json @@ -71,6 +71,42 @@ "commitCharacters": null, "command": null }, + { + "label": "$ref", + "kind": [ + + ], + "detail": "unknown", + "documentation": "reference tag", + "deprecated": [ + + ], + "preselect": [ + + ], + "sortText": "0$ref", + "filterText": "\"\\$ref\": \"$1\"", + "insertText": null, + "insertTextFormat": [ + 2 + ], + "textEdit": { + "range": { + "start": { + "line": 7, + "character": 10 + }, + "end": { + "line": 7, + "character": 10 + } + }, + "newText": "\"\\$ref\": \"$1\"" + }, + "additionalTextEdits": null, + "commitCharacters": null, + "command": null + }, { "label": "allOf", "kind": [ diff --git a/als-suggestions/shared/src/test/resources/test/jsonschema/draft2019/by-directory/encodes/properties/expected/inside.json.json b/als-suggestions/shared/src/test/resources/test/jsonschema/draft2019/by-directory/encodes/properties/expected/inside.json.json index 3eb39af95..76ca0f47d 100644 --- a/als-suggestions/shared/src/test/resources/test/jsonschema/draft2019/by-directory/encodes/properties/expected/inside.json.json +++ b/als-suggestions/shared/src/test/resources/test/jsonschema/draft2019/by-directory/encodes/properties/expected/inside.json.json @@ -71,6 +71,42 @@ "commitCharacters": null, "command": null }, + { + "label": "$ref", + "kind": [ + + ], + "detail": "unknown", + "documentation": "reference tag", + "deprecated": [ + + ], + "preselect": [ + + ], + "sortText": "0$ref", + "filterText": "\"\\$ref\": \"$1\"", + "insertText": null, + "insertTextFormat": [ + 2 + ], + "textEdit": { + "range": { + "start": { + "line": 5, + "character": 6 + }, + "end": { + "line": 5, + "character": 6 + } + }, + "newText": "\"\\$ref\": \"$1\"" + }, + "additionalTextEdits": null, + "commitCharacters": null, + "command": null + }, { "label": "allOf", "kind": [ diff --git a/als-suggestions/shared/src/test/resources/test/jsonschema/draft4/by-directory/definitions/properties/expected/inside.json.json b/als-suggestions/shared/src/test/resources/test/jsonschema/draft4/by-directory/definitions/properties/expected/inside.json.json index b2f130e80..7bc9da3e6 100644 --- a/als-suggestions/shared/src/test/resources/test/jsonschema/draft4/by-directory/definitions/properties/expected/inside.json.json +++ b/als-suggestions/shared/src/test/resources/test/jsonschema/draft4/by-directory/definitions/properties/expected/inside.json.json @@ -1,4 +1,40 @@ [ + { + "label": "$ref", + "kind": [ + + ], + "detail": "unknown", + "documentation": "reference tag", + "deprecated": [ + + ], + "preselect": [ + + ], + "sortText": "0$ref", + "filterText": "\"\\$ref\": \"$1\"", + "insertText": null, + "insertTextFormat": [ + 2 + ], + "textEdit": { + "range": { + "start": { + "line": 7, + "character": 10 + }, + "end": { + "line": 7, + "character": 10 + } + }, + "newText": "\"\\$ref\": \"$1\"" + }, + "additionalTextEdits": null, + "commitCharacters": null, + "command": null + }, { "label": "allOf", "kind": [ diff --git a/als-suggestions/shared/src/test/resources/test/jsonschema/draft4/by-directory/if/expected/inside.json.json b/als-suggestions/shared/src/test/resources/test/jsonschema/draft4/by-directory/if/expected/inside.json.json index 48dfde93e..fa51f404a 100644 --- a/als-suggestions/shared/src/test/resources/test/jsonschema/draft4/by-directory/if/expected/inside.json.json +++ b/als-suggestions/shared/src/test/resources/test/jsonschema/draft4/by-directory/if/expected/inside.json.json @@ -1,4 +1,40 @@ [ + { + "label": "$ref", + "kind": [ + + ], + "detail": "unknown", + "documentation": "reference tag", + "deprecated": [ + + ], + "preselect": [ + + ], + "sortText": "0$ref", + "filterText": "\"\\$ref\": \"$1\"", + "insertText": null, + "insertTextFormat": [ + 2 + ], + "textEdit": { + "range": { + "start": { + "line": 15, + "character": 38 + }, + "end": { + "line": 15, + "character": 38 + } + }, + "newText": "\"\\$ref\": \"$1\"" + }, + "additionalTextEdits": null, + "commitCharacters": null, + "command": null + }, { "label": "additionalProperties", "kind": [ diff --git a/als-suggestions/shared/src/test/resources/test/jsonschema/draft7/by-directory/definitions/if/expected/inside.json.json b/als-suggestions/shared/src/test/resources/test/jsonschema/draft7/by-directory/definitions/if/expected/inside.json.json index 8a1b7fd9f..3b0705ecb 100644 --- a/als-suggestions/shared/src/test/resources/test/jsonschema/draft7/by-directory/definitions/if/expected/inside.json.json +++ b/als-suggestions/shared/src/test/resources/test/jsonschema/draft7/by-directory/definitions/if/expected/inside.json.json @@ -71,6 +71,42 @@ "commitCharacters": null, "command": null }, + { + "label": "$ref", + "kind": [ + + ], + "detail": "unknown", + "documentation": "reference tag", + "deprecated": [ + + ], + "preselect": [ + + ], + "sortText": "0$ref", + "filterText": "\"\\$ref\": \"$1\"", + "insertText": null, + "insertTextFormat": [ + 2 + ], + "textEdit": { + "range": { + "start": { + "line": 15, + "character": 38 + }, + "end": { + "line": 15, + "character": 38 + } + }, + "newText": "\"\\$ref\": \"$1\"" + }, + "additionalTextEdits": null, + "commitCharacters": null, + "command": null + }, { "label": "allOf", "kind": [ diff --git a/als-suggestions/shared/src/test/resources/test/jsonschema/draft7/by-directory/definitions/properties/expected/inside.json.json b/als-suggestions/shared/src/test/resources/test/jsonschema/draft7/by-directory/definitions/properties/expected/inside.json.json index bc5b4b8cc..42c680abe 100644 --- a/als-suggestions/shared/src/test/resources/test/jsonschema/draft7/by-directory/definitions/properties/expected/inside.json.json +++ b/als-suggestions/shared/src/test/resources/test/jsonschema/draft7/by-directory/definitions/properties/expected/inside.json.json @@ -71,6 +71,42 @@ "commitCharacters": null, "command": null }, + { + "label": "$ref", + "kind": [ + + ], + "detail": "unknown", + "documentation": "reference tag", + "deprecated": [ + + ], + "preselect": [ + + ], + "sortText": "0$ref", + "filterText": "\"\\$ref\": \"$1\"", + "insertText": null, + "insertTextFormat": [ + 2 + ], + "textEdit": { + "range": { + "start": { + "line": 7, + "character": 10 + }, + "end": { + "line": 7, + "character": 10 + } + }, + "newText": "\"\\$ref\": \"$1\"" + }, + "additionalTextEdits": null, + "commitCharacters": null, + "command": null + }, { "label": "allOf", "kind": [ diff --git a/als-suggestions/shared/src/test/resources/test/jsonschema/draft7/by-directory/encodes/properties/expected/inside.json.json b/als-suggestions/shared/src/test/resources/test/jsonschema/draft7/by-directory/encodes/properties/expected/inside.json.json index 3eb39af95..76ca0f47d 100644 --- a/als-suggestions/shared/src/test/resources/test/jsonschema/draft7/by-directory/encodes/properties/expected/inside.json.json +++ b/als-suggestions/shared/src/test/resources/test/jsonschema/draft7/by-directory/encodes/properties/expected/inside.json.json @@ -71,6 +71,42 @@ "commitCharacters": null, "command": null }, + { + "label": "$ref", + "kind": [ + + ], + "detail": "unknown", + "documentation": "reference tag", + "deprecated": [ + + ], + "preselect": [ + + ], + "sortText": "0$ref", + "filterText": "\"\\$ref\": \"$1\"", + "insertText": null, + "insertTextFormat": [ + 2 + ], + "textEdit": { + "range": { + "start": { + "line": 5, + "character": 6 + }, + "end": { + "line": 5, + "character": 6 + } + }, + "newText": "\"\\$ref\": \"$1\"" + }, + "additionalTextEdits": null, + "commitCharacters": null, + "command": null + }, { "label": "allOf", "kind": [ From 613c8ebd67e40e0d5c57ff30700b22ed13690d10 Mon Sep 17 00:00:00 2001 From: franciscolosardo <47782217+franciscolosardo@users.noreply.github.com> Date: Wed, 9 Oct 2024 10:47:05 -0300 Subject: [PATCH 06/10] W-15702938 Added tests for AVRO and AVRO support in async2.6 (#1075) * Added tests for AVRO and AVRO support in async2.6 * File changes * Made changes to test failing due to error message uneven between JVM & JS * Lowercase check in test * Some changes requested in PR --- .../avro/async26-imports-invalid-avro.yaml | 23 +++++++ .../avro/async26-imports-valid-avro.yaml | 15 +++++ .../avro/schemas/avro-user/avrotoavro.avsc | 20 ++++++ .../schemas/union-type-invalid-payload.avsc | 20 ++++++ .../union-type-payload-error.avsc | 0 .../avro/schemas/union-type-payload.avsc | 20 ++++++ .../diagnostic/BasicCleanDiagnosticTest.scala | 27 +------- .../async/Async26CleanDiagnosticTest.scala | 27 ++++++++ .../avro/AvroCleanDiagnosticTest.scala | 67 +++++++++++++++++++ 9 files changed, 193 insertions(+), 26 deletions(-) create mode 100644 als-server/shared/src/test/resources/diagnostics/avro/async26-imports-invalid-avro.yaml create mode 100644 als-server/shared/src/test/resources/diagnostics/avro/async26-imports-valid-avro.yaml create mode 100644 als-server/shared/src/test/resources/diagnostics/avro/schemas/avro-user/avrotoavro.avsc create mode 100644 als-server/shared/src/test/resources/diagnostics/avro/schemas/union-type-invalid-payload.avsc rename als-server/shared/src/test/resources/diagnostics/avro/{ => schemas}/union-type-payload-error.avsc (100%) create mode 100644 als-server/shared/src/test/resources/diagnostics/avro/schemas/union-type-payload.avsc create mode 100644 als-server/shared/src/test/scala/org/mulesoft/als/server/modules/diagnostic/support/async/Async26CleanDiagnosticTest.scala create mode 100644 als-server/shared/src/test/scala/org/mulesoft/als/server/modules/diagnostic/support/avro/AvroCleanDiagnosticTest.scala diff --git a/als-server/shared/src/test/resources/diagnostics/avro/async26-imports-invalid-avro.yaml b/als-server/shared/src/test/resources/diagnostics/avro/async26-imports-invalid-avro.yaml new file mode 100644 index 000000000..8e8bb6b18 --- /dev/null +++ b/als-server/shared/src/test/resources/diagnostics/avro/async26-imports-invalid-avro.yaml @@ -0,0 +1,23 @@ +asyncapi: 2.6.0 +info: + title: Market Data API + version: 1.0.0 + description: This API provides real-time market data updates. + +channels: + m1: + description: Pancho + +components: + messages: + m1: + schemaFormat: application/vnd.apache.avro;version=1.9.0 + payload: + $ref: schemas/union-type-invalid-payload.avsc + examples: + - payload: + name: John Doe + address: + zipcode: 1355 + age: 20 + favoriteProgrammingLanguage: Java \ No newline at end of file diff --git a/als-server/shared/src/test/resources/diagnostics/avro/async26-imports-valid-avro.yaml b/als-server/shared/src/test/resources/diagnostics/avro/async26-imports-valid-avro.yaml new file mode 100644 index 000000000..3776f14b7 --- /dev/null +++ b/als-server/shared/src/test/resources/diagnostics/avro/async26-imports-valid-avro.yaml @@ -0,0 +1,15 @@ +asyncapi: 2.6.0 +info: + title: Market Data API + version: 1.0.0 + description: This API provides real-time market data updates. +channels: + m1: + description: Pancho + +components: + messages: + m1: + schemaFormat: application/vnd.apache.avro;version=1.9.0 + payload: + $ref: schemas/union-type-payload.avsc \ No newline at end of file diff --git a/als-server/shared/src/test/resources/diagnostics/avro/schemas/avro-user/avrotoavro.avsc b/als-server/shared/src/test/resources/diagnostics/avro/schemas/avro-user/avrotoavro.avsc new file mode 100644 index 000000000..4d560fa65 --- /dev/null +++ b/als-server/shared/src/test/resources/diagnostics/avro/schemas/avro-user/avrotoavro.avsc @@ -0,0 +1,20 @@ +{ + "type" : "record", + "name" : "avrotoavro", + "fields" : [ + {"name": "user_user", "type": { + "name": "user", + "type": "record", + "fields": [ + { + "name": "username", + "type": "string" + }, + { + "name": "age", + "type": "int" + } + ] + }} + ] +} \ No newline at end of file diff --git a/als-server/shared/src/test/resources/diagnostics/avro/schemas/union-type-invalid-payload.avsc b/als-server/shared/src/test/resources/diagnostics/avro/schemas/union-type-invalid-payload.avsc new file mode 100644 index 000000000..24f929f5c --- /dev/null +++ b/als-server/shared/src/test/resources/diagnostics/avro/schemas/union-type-invalid-payload.avsc @@ -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"}, {"name": "zipcode", "type": "boolean"}] + } + } + ] +} \ No newline at end of file diff --git a/als-server/shared/src/test/resources/diagnostics/avro/union-type-payload-error.avsc b/als-server/shared/src/test/resources/diagnostics/avro/schemas/union-type-payload-error.avsc similarity index 100% rename from als-server/shared/src/test/resources/diagnostics/avro/union-type-payload-error.avsc rename to als-server/shared/src/test/resources/diagnostics/avro/schemas/union-type-payload-error.avsc diff --git a/als-server/shared/src/test/resources/diagnostics/avro/schemas/union-type-payload.avsc b/als-server/shared/src/test/resources/diagnostics/avro/schemas/union-type-payload.avsc new file mode 100644 index 000000000..07cd0fb76 --- /dev/null +++ b/als-server/shared/src/test/resources/diagnostics/avro/schemas/union-type-payload.avsc @@ -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"}] + } + } + ] +} \ No newline at end of file diff --git a/als-server/shared/src/test/scala/org/mulesoft/als/server/modules/diagnostic/BasicCleanDiagnosticTest.scala b/als-server/shared/src/test/scala/org/mulesoft/als/server/modules/diagnostic/BasicCleanDiagnosticTest.scala index 62e06ca4a..2535e5401 100644 --- a/als-server/shared/src/test/scala/org/mulesoft/als/server/modules/diagnostic/BasicCleanDiagnosticTest.scala +++ b/als-server/shared/src/test/scala/org/mulesoft/als/server/modules/diagnostic/BasicCleanDiagnosticTest.scala @@ -5,6 +5,7 @@ import org.mulesoft.als.server.client.scala.LanguageServerBuilder import org.mulesoft.als.server.modules.WorkspaceManagerFactoryBuilder import org.mulesoft.als.server.protocol.LanguageServer import org.mulesoft.als.server.{LanguageServerBaseTest, MockDiagnosticClientNotifier} +import org.mulesoft.lsp.feature.diagnostic.DiagnosticSeverity import scala.concurrent.ExecutionContext @@ -13,32 +14,6 @@ class BasicCleanDiagnosticTest extends LanguageServerBaseTest { override implicit def executionContext: ExecutionContext = scala.concurrent.ExecutionContext.Implicits.global override def rootPath: String = "diagnostics" - test("async 2.6 with only one error") { - withServer(buildServer()) { server => - for { - d <- requestCleanDiagnostic(server)(filePath("async26/async-api26-full.yaml")) - } yield { - server.shutdown() - assert(d.size == 1) - assert(d.head.diagnostics.size == 1) - assert(d.head.diagnostics.head.message == "Property 'error' not supported in a ASYNC 2.6 webApi node") - assert(d.head.profile == ProfileNames.ASYNC26) - } - } - } - - 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 = { diff --git a/als-server/shared/src/test/scala/org/mulesoft/als/server/modules/diagnostic/support/async/Async26CleanDiagnosticTest.scala b/als-server/shared/src/test/scala/org/mulesoft/als/server/modules/diagnostic/support/async/Async26CleanDiagnosticTest.scala new file mode 100644 index 000000000..93efea05b --- /dev/null +++ b/als-server/shared/src/test/scala/org/mulesoft/als/server/modules/diagnostic/support/async/Async26CleanDiagnosticTest.scala @@ -0,0 +1,27 @@ +package org.mulesoft.als.server.modules.diagnostic.support.async + +import amf.core.client.common.validation.ProfileNames +import org.mulesoft.als.server.client.scala.LanguageServerBuilder +import org.mulesoft.als.server.modules.WorkspaceManagerFactoryBuilder +import org.mulesoft.als.server.modules.diagnostic.BasicCleanDiagnosticTest +import org.mulesoft.als.server.protocol.LanguageServer +import org.mulesoft.als.server.{LanguageServerBaseTest, MockDiagnosticClientNotifier} + +import scala.concurrent.ExecutionContext + +class Async26CleanDiagnosticTest extends BasicCleanDiagnosticTest { + + test("async 2.6 with only one error") { + withServer(buildServer()) { server => + for { + d <- requestCleanDiagnostic(server)(filePath("async26/async-api26-full.yaml")) + } yield { + server.shutdown() + assert(d.size == 1) + assert(d.head.diagnostics.size == 1) + assert(d.head.diagnostics.head.message == "Property 'error' not supported in a ASYNC 2.6 webApi node") + assert(d.head.profile == ProfileNames.ASYNC26) + } + } + } +} diff --git a/als-server/shared/src/test/scala/org/mulesoft/als/server/modules/diagnostic/support/avro/AvroCleanDiagnosticTest.scala b/als-server/shared/src/test/scala/org/mulesoft/als/server/modules/diagnostic/support/avro/AvroCleanDiagnosticTest.scala new file mode 100644 index 000000000..3352bedb5 --- /dev/null +++ b/als-server/shared/src/test/scala/org/mulesoft/als/server/modules/diagnostic/support/avro/AvroCleanDiagnosticTest.scala @@ -0,0 +1,67 @@ +package org.mulesoft.als.server.modules.diagnostic.support.avro + +import amf.core.client.common.validation.ProfileNames +import org.mulesoft.als.server.modules.diagnostic.BasicCleanDiagnosticTest +import org.mulesoft.lsp.feature.diagnostic.DiagnosticSeverity + + +class AvroCleanDiagnosticTest extends BasicCleanDiagnosticTest { + + test("Async importing valid Avro") { + withServer(buildServer()) { server => + for { + d <- requestCleanDiagnostic(server)(filePath("avro/async26-imports-valid-avro.yaml")) + } yield { + server.shutdown() + d.foreach(filediag => assert(filediag.diagnostics.isEmpty)) + assert(d.size == 2) + assert(d.head.profile == ProfileNames.ASYNC26) + } + } + } + + test("Async importing invalid Avro") { + withServer(buildServer()) { server => + for { + d <- requestCleanDiagnostic(server)(filePath("avro/async26-imports-invalid-avro.yaml")) + } yield { + server.shutdown() + assert(d.size == 2) + val avroFileDiagnostics = d.find(d => d.uri.contains("avro/async26-imports-invalid-avro.yaml")) + assert(avroFileDiagnostics.isDefined) + assert(avroFileDiagnostics.get.diagnostics.length == 1) + val errorMessage = avroFileDiagnostics.get.diagnostics.head.message.toLowerCase() + assert(errorMessage.contains("duplicate") && errorMessage.contains("address")) + assert(avroFileDiagnostics.get.diagnostics.head.severity.get == DiagnosticSeverity.Error) + assert(avroFileDiagnostics.get.profile == ProfileNames.ASYNC26) + } + } + } + + + test("valid complex avro") { + withServer(buildServer()) { server => + for { + d <- requestCleanDiagnostic(server)(filePath("avro/schemas/avro-user/avrotoavro.avsc")) + } yield { + server.shutdown() + assert(d.size == 1) + assert(d.head.diagnostics.isEmpty) + assert(d.head.profile == ProfileNames.AVROSCHEMA) + } + } + } + + test("valid avro with unions") { + withServer(buildServer()) { server => + for { + d <- requestCleanDiagnostic(server)(filePath("avro/schemas/union-type-payload-error.avsc")) + } yield { + server.shutdown() + assert(d.size == 1) + assert(d.head.diagnostics.isEmpty) + assert(d.head.profile == ProfileNames.AVROSCHEMA) + } + } + } +} From 8f0aca9ef16a92ee96e676996db05916572316b0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 12:16:28 -0300 Subject: [PATCH 07/10] Bump elliptic from 6.5.4 to 6.5.7 in /als-node-client/node-package (#1056) Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.4 to 6.5.7. - [Commits](https://github.com/indutny/elliptic/compare/v6.5.4...v6.5.7) --- updated-dependencies: - dependency-name: elliptic dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: emilianoascona <39959392+emilianoascona@users.noreply.github.com> --- als-node-client/node-package/package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/als-node-client/node-package/package-lock.json b/als-node-client/node-package/package-lock.json index 4035e9ffe..ac0fd2aff 100644 --- a/als-node-client/node-package/package-lock.json +++ b/als-node-client/node-package/package-lock.json @@ -339,9 +339,9 @@ "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" }, "node_modules/elliptic": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", - "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "version": "6.5.7", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.7.tgz", + "integrity": "sha512-ESVCtTwiA+XhY3wyh24QqRGBoP3rEdDUl3EDUUo9tft074fi19IrdpH7hLCMMP3CIj7jb3W96rn8lt/BqIlt5Q==", "dependencies": { "bn.js": "^4.11.9", "brorand": "^1.1.0", @@ -1139,9 +1139,9 @@ } }, "elliptic": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", - "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "version": "6.5.7", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.7.tgz", + "integrity": "sha512-ESVCtTwiA+XhY3wyh24QqRGBoP3rEdDUl3EDUUo9tft074fi19IrdpH7hLCMMP3CIj7jb3W96rn8lt/BqIlt5Q==", "requires": { "bn.js": "^4.11.9", "brorand": "^1.1.0", From 0dfccdcbb418c8ab5627b0d09adacb885282c6c6 Mon Sep 17 00:00:00 2001 From: Lele <45210281+llibarona@users.noreply.github.com> Date: Wed, 23 Oct 2024 12:12:23 -0300 Subject: [PATCH 08/10] W-17007396: enhancement in suggestions styler so that we can suggest values in complex nodes (#1079) --- .../styler/astbuilder/AstRawBuilder.scala | 17 +++++++-- .../YamlSuggestionStylerTest.scala | 37 +++++++++++++++++++ 2 files changed, 51 insertions(+), 3 deletions(-) diff --git a/als-suggestions/shared/src/main/scala/org/mulesoft/als/suggestions/styler/astbuilder/AstRawBuilder.scala b/als-suggestions/shared/src/main/scala/org/mulesoft/als/suggestions/styler/astbuilder/AstRawBuilder.scala index bc5655f69..3cb5c8fb6 100644 --- a/als-suggestions/shared/src/main/scala/org/mulesoft/als/suggestions/styler/astbuilder/AstRawBuilder.scala +++ b/als-suggestions/shared/src/main/scala/org/mulesoft/als/suggestions/styler/astbuilder/AstRawBuilder.scala @@ -24,6 +24,7 @@ abstract class AstRawBuilder(val raw: RawSuggestion, isSnippet: Boolean, yPartBr def emptyNode(): YNode + def keyTag(rawSuggestion: RawSuggestion): YType = if (rawSuggestion.options.keyRange == NumberScalarRange) YType.Int else YType.Str lazy val keyTag: YType = if (raw.options.keyRange == NumberScalarRange) YType.Int else YType.Str lazy val valueTag: YType = raw.options.rangeKind match { @@ -43,7 +44,15 @@ abstract class AstRawBuilder(val raw: RawSuggestion, isSnippet: Boolean, yPartBr if (raw.children.nonEmpty && raw.newText.isEmpty) { // if entry has value but key is empty, user will need to fill out snippet = true YMapEntry("$" + index.toString, valueNode(index + 1)) - } else YMapEntry(scalar(raw.newText, keyTag), valueNode(index)) + } else { + if (raw.children.nonEmpty && !raw.children.exists(_.options.isKey)) { + val seq = raw.children.map(child => scalar(child.newText, keyTag(child))).toIndexedSeq + if(raw.options.isArray) + YMapEntry(scalar(raw.newText, keyTag), YSequence(seq)) + else YMapEntry(scalar(raw.newText, keyTag), seq.head) + } + else YMapEntry(scalar(raw.newText, keyTag), valueNode(index)) + } private def valueObject(index: Integer): YNode = { val list = if (raw.children.nonEmpty) { @@ -51,8 +60,10 @@ abstract class AstRawBuilder(val raw: RawSuggestion, isSnippet: Boolean, yPartBr raw.children.zipWithIndex .map(t => newInstance(t._1, true).emitKey(t._2 + index)) .toIndexedSeq - } else if (isSnippet) IndexedSeq(YMapEntry("$" + index.toString, emptyNode())) - else IndexedSeq.empty + } else if (isSnippet) + IndexedSeq(YMapEntry("$" + index.toString, emptyNode())) + else + IndexedSeq.empty val n = YNode(YMap(emptyLocation, list)) diff --git a/als-suggestions/shared/src/test/scala/org/mulesoft/als/suggestions/YamlSuggestionStylerTest.scala b/als-suggestions/shared/src/test/scala/org/mulesoft/als/suggestions/YamlSuggestionStylerTest.scala index 7116414af..b27e501b9 100644 --- a/als-suggestions/shared/src/test/scala/org/mulesoft/als/suggestions/YamlSuggestionStylerTest.scala +++ b/als-suggestions/shared/src/test/scala/org/mulesoft/als/suggestions/YamlSuggestionStylerTest.scala @@ -231,4 +231,41 @@ class YamlSuggestionStylerTest extends AsyncFunSuite with FileAssertionTest { assert(completionItem.additionalTextEdits.exists(_.contains(edit))) } + test("render RawSuggestion with children and set values") { + val styler = YamlSuggestionStyler( + SyamlStylerParams( + "", + Position(0, 0), + dummyYPart, + FormattingOptions(2, insertSpaces = true) + ) + ) + + val golden = """root: + | k1: $1 + | k2: v1 + | k3: + | - v1 + | - v2 + | - v3""".stripMargin + val rawSuggestion = RawSuggestion("root", SuggestionStructure(ObjectRange, isKey = true)) + .withChildren(Seq( + RawSuggestion( + "k1", SuggestionStructure(BoolScalarRange, isKey = true) + ), + RawSuggestion("k2", SuggestionStructure(StringScalarRange, isKey = true)) + .withChildren(Seq(RawSuggestion("v1", isAKey = false))), + RawSuggestion("k3", SuggestionStructure(ArrayRange, isKey = true)) + .withChildren(Seq( + RawSuggestion("v1", isAKey = false), + RawSuggestion("v2", isAKey = false), + RawSuggestion("v3", isAKey = false), + )) + )) + + val result = styler.style(rawSuggestion).text + + assert(result == golden) + } + } From ad7dfcdf05938fa65381e5ad49d3504f44fdf0d6 Mon Sep 17 00:00:00 2001 From: franciscolosardo <47782217+franciscolosardo@users.noreply.github.com> Date: Fri, 25 Oct 2024 09:28:51 -0300 Subject: [PATCH 09/10] W-17062253 Bumped dependencies (#1080) * Bumped dependencies * Bumped dependencies adapted tests --- als-actions/js/package-lock.json | 14 +++++++------- als-actions/js/package.json | 2 +- .../actions/hover/async-api20-full-result.yaml | 4 ++-- .../actions/hover/async-api26-full-result.yaml | 16 ++++++++-------- .../actions/hover/oas30-full-result.yaml | 4 ++-- als-common/js/package-lock.json | 14 +++++++------- als-common/js/package.json | 2 +- als-node-client/node-package/package-lock.json | 14 +++++++------- als-node-client/node-package/package.json | 2 +- als-server/js/node-package/package-lock.json | 14 +++++++------- als-server/js/node-package/package.json | 2 +- .../diagnostics/project/api.raml.jsonld | 2 +- .../diagnostics/project/isolated.raml.jsonld | 2 +- .../abstract-declaration/main.jsonld | 4 ++-- als-structure/js/package-lock.json | 14 +++++++------- als-structure/js/package.json | 2 +- als-suggestions/js/package-lock.json | 14 +++++++------- als-suggestions/js/package.json | 2 +- dependencies.properties | 6 +++--- 19 files changed, 67 insertions(+), 67 deletions(-) diff --git a/als-actions/js/package-lock.json b/als-actions/js/package-lock.json index 0081026cc..a0e1bd021 100644 --- a/als-actions/js/package-lock.json +++ b/als-actions/js/package-lock.json @@ -9,15 +9,15 @@ "version": "1.0.0", "license": "ISC", "dependencies": { - "@aml-org/amf-antlr-parsers": "0.7.25", + "@aml-org/amf-antlr-parsers": "0.7.27", "ajv": "6.12.6", "avro-js": "1.12.0" } }, "node_modules/@aml-org/amf-antlr-parsers": { - "version": "0.7.25", - "resolved": "https://registry.npmjs.org/@aml-org/amf-antlr-parsers/-/amf-antlr-parsers-0.7.25.tgz", - "integrity": "sha512-JEwX1Ja8SFbcYboOEbZ+t//w1sWULGKRV3x0moDpKR+MWjL69FWy484/u0GXHBYdydtbGHM4NcKltYNOaH5Bmw==" + "version": "0.7.27", + "resolved": "https://registry.npmjs.org/@aml-org/amf-antlr-parsers/-/amf-antlr-parsers-0.7.27.tgz", + "integrity": "sha512-TUh9kOweGuL2C8eaA0YRJy6YEMGlGhSUFnrZ7tgBTxLOhDr/Q5PiE4U1tYkvkqc2kBD3cY82ftRcq9nIcFDB0Q==" }, "node_modules/ajv": { "version": "6.12.6", @@ -81,9 +81,9 @@ }, "dependencies": { "@aml-org/amf-antlr-parsers": { - "version": "0.7.25", - "resolved": "https://registry.npmjs.org/@aml-org/amf-antlr-parsers/-/amf-antlr-parsers-0.7.25.tgz", - "integrity": "sha512-JEwX1Ja8SFbcYboOEbZ+t//w1sWULGKRV3x0moDpKR+MWjL69FWy484/u0GXHBYdydtbGHM4NcKltYNOaH5Bmw==" + "version": "0.7.27", + "resolved": "https://registry.npmjs.org/@aml-org/amf-antlr-parsers/-/amf-antlr-parsers-0.7.27.tgz", + "integrity": "sha512-TUh9kOweGuL2C8eaA0YRJy6YEMGlGhSUFnrZ7tgBTxLOhDr/Q5PiE4U1tYkvkqc2kBD3cY82ftRcq9nIcFDB0Q==" }, "ajv": { "version": "6.12.6", diff --git a/als-actions/js/package.json b/als-actions/js/package.json index e353b5a25..fd505ed5b 100644 --- a/als-actions/js/package.json +++ b/als-actions/js/package.json @@ -6,7 +6,7 @@ "test": "echo \"Error: no test specified\" && exit 1" }, "dependencies": { - "@aml-org/amf-antlr-parsers": "0.7.25", + "@aml-org/amf-antlr-parsers": "0.7.27", "ajv": "6.12.6", "avro-js": "1.12.0" }, diff --git a/als-actions/shared/src/test/resources/actions/hover/async-api20-full-result.yaml b/als-actions/shared/src/test/resources/actions/hover/async-api20-full-result.yaml index d554aba5d..80ef56965 100644 --- a/als-actions/shared/src/test/resources/actions/hover/async-api20-full-result.yaml +++ b/als-actions/shared/src/test/resources/actions/hover/async-api20-full-result.yaml @@ -100,9 +100,9 @@ hovers: (26,17): - Piece of data required or returned by an Operation (27,13): - - Piece of data required or returned by an Operation + - Human readable description of an element (27,27): - - Piece of data required or returned by an Operation + - Human readable description of an element (28,12): - Examples for a particular element declaration (28,17): diff --git a/als-actions/shared/src/test/resources/actions/hover/async-api26-full-result.yaml b/als-actions/shared/src/test/resources/actions/hover/async-api26-full-result.yaml index 459fd1d88..075d66097 100644 --- a/als-actions/shared/src/test/resources/actions/hover/async-api26-full-result.yaml +++ b/als-actions/shared/src/test/resources/actions/hover/async-api26-full-result.yaml @@ -84,9 +84,9 @@ hovers: (24,18): - Piece of data required or returned by an Operation (25,13): - - Piece of data required or returned by an Operation + - Human readable description of an element (25,28): - - Piece of data required or returned by an Operation + - Human readable description of an element (26,9): - Human readable name for the object (26,14): @@ -96,9 +96,9 @@ hovers: (27,18): - Piece of data required or returned by an Operation (28,13): - - Piece of data required or returned by an Operation + - Human readable description of an element (28,26): - - Piece of data required or returned by an Operation + - Human readable description of an element (29,7): - Information about the network accessible locations where the API is available (29,14): @@ -739,9 +739,9 @@ hovers: (209,18): - Piece of data required or returned by an Operation (210,11): - - Piece of data required or returned by an Operation + - Human readable description of an element (210,32): - - Piece of data required or returned by an Operation + - Human readable description of an element (211,7): - Piece of data required or returned by an Operation (211,12): @@ -751,9 +751,9 @@ hovers: (212,16): - Piece of data required or returned by an Operation (213,11): - - Piece of data required or returned by an Operation + - Human readable description of an element (213,30): - - Piece of data required or returned by an Operation + - Human readable description of an element (214,9): - Top level element describing a asynchronous API (214,18): diff --git a/als-actions/shared/src/test/resources/actions/hover/oas30-full-result.yaml b/als-actions/shared/src/test/resources/actions/hover/oas30-full-result.yaml index c747bd7d4..66013acf5 100644 --- a/als-actions/shared/src/test/resources/actions/hover/oas30-full-result.yaml +++ b/als-actions/shared/src/test/resources/actions/hover/oas30-full-result.yaml @@ -84,9 +84,9 @@ hovers: (23,20): - Piece of data required or returned by an Operation (24,13): - - Piece of data required or returned by an Operation + - Human readable description of an element (24,63): - - Piece of data required or returned by an Operation + - Human readable description of an element (26,2): - Path to each declared endpoint. Relative to basePath (26,6): diff --git a/als-common/js/package-lock.json b/als-common/js/package-lock.json index b69b47a18..3094571c3 100644 --- a/als-common/js/package-lock.json +++ b/als-common/js/package-lock.json @@ -9,15 +9,15 @@ "version": "1.0.0", "license": "ISC", "dependencies": { - "@aml-org/amf-antlr-parsers": "0.7.25", + "@aml-org/amf-antlr-parsers": "0.7.27", "ajv": "6.12.6", "avro-js": "1.12.0" } }, "node_modules/@aml-org/amf-antlr-parsers": { - "version": "0.7.25", - "resolved": "https://registry.npmjs.org/@aml-org/amf-antlr-parsers/-/amf-antlr-parsers-0.7.25.tgz", - "integrity": "sha512-JEwX1Ja8SFbcYboOEbZ+t//w1sWULGKRV3x0moDpKR+MWjL69FWy484/u0GXHBYdydtbGHM4NcKltYNOaH5Bmw==" + "version": "0.7.27", + "resolved": "https://registry.npmjs.org/@aml-org/amf-antlr-parsers/-/amf-antlr-parsers-0.7.27.tgz", + "integrity": "sha512-TUh9kOweGuL2C8eaA0YRJy6YEMGlGhSUFnrZ7tgBTxLOhDr/Q5PiE4U1tYkvkqc2kBD3cY82ftRcq9nIcFDB0Q==" }, "node_modules/ajv": { "version": "6.12.6", @@ -81,9 +81,9 @@ }, "dependencies": { "@aml-org/amf-antlr-parsers": { - "version": "0.7.25", - "resolved": "https://registry.npmjs.org/@aml-org/amf-antlr-parsers/-/amf-antlr-parsers-0.7.25.tgz", - "integrity": "sha512-JEwX1Ja8SFbcYboOEbZ+t//w1sWULGKRV3x0moDpKR+MWjL69FWy484/u0GXHBYdydtbGHM4NcKltYNOaH5Bmw==" + "version": "0.7.27", + "resolved": "https://registry.npmjs.org/@aml-org/amf-antlr-parsers/-/amf-antlr-parsers-0.7.27.tgz", + "integrity": "sha512-TUh9kOweGuL2C8eaA0YRJy6YEMGlGhSUFnrZ7tgBTxLOhDr/Q5PiE4U1tYkvkqc2kBD3cY82ftRcq9nIcFDB0Q==" }, "ajv": { "version": "6.12.6", diff --git a/als-common/js/package.json b/als-common/js/package.json index 60c1bd601..412c50d7e 100644 --- a/als-common/js/package.json +++ b/als-common/js/package.json @@ -6,7 +6,7 @@ "test": "echo \"Error: no test specified\" && exit 1" }, "dependencies": { - "@aml-org/amf-antlr-parsers": "0.7.25", + "@aml-org/amf-antlr-parsers": "0.7.27", "ajv": "6.12.6", "avro-js": "1.12.0" }, diff --git a/als-node-client/node-package/package-lock.json b/als-node-client/node-package/package-lock.json index ac0fd2aff..7c51ee40b 100644 --- a/als-node-client/node-package/package-lock.json +++ b/als-node-client/node-package/package-lock.json @@ -9,7 +9,7 @@ "version": "5.1.0-SNAPSHOT", "license": "Apache-2.0", "dependencies": { - "@aml-org/amf-antlr-parsers": "0.7.25", + "@aml-org/amf-antlr-parsers": "0.7.27", "@aml-org/amf-custom-validator": "1.7.2", "@aml-org/amf-custom-validator-web": "1.7.2", "ajv": "6.12.6", @@ -22,9 +22,9 @@ } }, "node_modules/@aml-org/amf-antlr-parsers": { - "version": "0.7.25", - "resolved": "https://registry.npmjs.org/@aml-org/amf-antlr-parsers/-/amf-antlr-parsers-0.7.25.tgz", - "integrity": "sha512-JEwX1Ja8SFbcYboOEbZ+t//w1sWULGKRV3x0moDpKR+MWjL69FWy484/u0GXHBYdydtbGHM4NcKltYNOaH5Bmw==" + "version": "0.7.27", + "resolved": "https://registry.npmjs.org/@aml-org/amf-antlr-parsers/-/amf-antlr-parsers-0.7.27.tgz", + "integrity": "sha512-TUh9kOweGuL2C8eaA0YRJy6YEMGlGhSUFnrZ7tgBTxLOhDr/Q5PiE4U1tYkvkqc2kBD3cY82ftRcq9nIcFDB0Q==" }, "node_modules/@aml-org/amf-custom-validator": { "version": "1.7.2", @@ -869,9 +869,9 @@ }, "dependencies": { "@aml-org/amf-antlr-parsers": { - "version": "0.7.25", - "resolved": "https://registry.npmjs.org/@aml-org/amf-antlr-parsers/-/amf-antlr-parsers-0.7.25.tgz", - "integrity": "sha512-JEwX1Ja8SFbcYboOEbZ+t//w1sWULGKRV3x0moDpKR+MWjL69FWy484/u0GXHBYdydtbGHM4NcKltYNOaH5Bmw==" + "version": "0.7.27", + "resolved": "https://registry.npmjs.org/@aml-org/amf-antlr-parsers/-/amf-antlr-parsers-0.7.27.tgz", + "integrity": "sha512-TUh9kOweGuL2C8eaA0YRJy6YEMGlGhSUFnrZ7tgBTxLOhDr/Q5PiE4U1tYkvkqc2kBD3cY82ftRcq9nIcFDB0Q==" }, "@aml-org/amf-custom-validator": { "version": "1.7.2", diff --git a/als-node-client/node-package/package.json b/als-node-client/node-package/package.json index 27f8ce7df..7b8327140 100644 --- a/als-node-client/node-package/package.json +++ b/als-node-client/node-package/package.json @@ -15,7 +15,7 @@ "als": "./dist/als-node-client.min.js" }, "dependencies": { - "@aml-org/amf-antlr-parsers": "0.7.25", + "@aml-org/amf-antlr-parsers": "0.7.27", "@aml-org/amf-custom-validator": "1.7.2", "@aml-org/amf-custom-validator-web": "1.7.2", "ajv": "6.12.6", diff --git a/als-server/js/node-package/package-lock.json b/als-server/js/node-package/package-lock.json index 97585c113..2a9d8f2b9 100644 --- a/als-server/js/node-package/package-lock.json +++ b/als-server/js/node-package/package-lock.json @@ -9,7 +9,7 @@ "version": "5.2.0-SNAPSHOT", "license": "Apache-2.0", "dependencies": { - "@aml-org/amf-antlr-parsers": "0.7.25", + "@aml-org/amf-antlr-parsers": "0.7.27", "@aml-org/amf-custom-validator": "1.7.2", "@aml-org/amf-custom-validator-web": "1.7.2", "ajv": "6.12.6", @@ -38,9 +38,9 @@ } }, "node_modules/@aml-org/amf-antlr-parsers": { - "version": "0.7.25", - "resolved": "https://registry.npmjs.org/@aml-org/amf-antlr-parsers/-/amf-antlr-parsers-0.7.25.tgz", - "integrity": "sha512-JEwX1Ja8SFbcYboOEbZ+t//w1sWULGKRV3x0moDpKR+MWjL69FWy484/u0GXHBYdydtbGHM4NcKltYNOaH5Bmw==" + "version": "0.7.27", + "resolved": "https://registry.npmjs.org/@aml-org/amf-antlr-parsers/-/amf-antlr-parsers-0.7.27.tgz", + "integrity": "sha512-TUh9kOweGuL2C8eaA0YRJy6YEMGlGhSUFnrZ7tgBTxLOhDr/Q5PiE4U1tYkvkqc2kBD3cY82ftRcq9nIcFDB0Q==" }, "node_modules/@aml-org/amf-custom-validator": { "version": "1.7.2", @@ -4759,9 +4759,9 @@ }, "dependencies": { "@aml-org/amf-antlr-parsers": { - "version": "0.7.25", - "resolved": "https://registry.npmjs.org/@aml-org/amf-antlr-parsers/-/amf-antlr-parsers-0.7.25.tgz", - "integrity": "sha512-JEwX1Ja8SFbcYboOEbZ+t//w1sWULGKRV3x0moDpKR+MWjL69FWy484/u0GXHBYdydtbGHM4NcKltYNOaH5Bmw==" + "version": "0.7.27", + "resolved": "https://registry.npmjs.org/@aml-org/amf-antlr-parsers/-/amf-antlr-parsers-0.7.27.tgz", + "integrity": "sha512-TUh9kOweGuL2C8eaA0YRJy6YEMGlGhSUFnrZ7tgBTxLOhDr/Q5PiE4U1tYkvkqc2kBD3cY82ftRcq9nIcFDB0Q==" }, "@aml-org/amf-custom-validator": { "version": "1.7.2", diff --git a/als-server/js/node-package/package.json b/als-server/js/node-package/package.json index 9624ca530..c3f6b65d0 100644 --- a/als-server/js/node-package/package.json +++ b/als-server/js/node-package/package.json @@ -15,7 +15,7 @@ "build:dist": "webpack --config ./webpack.config.js" }, "dependencies": { - "@aml-org/amf-antlr-parsers": "0.7.25", + "@aml-org/amf-antlr-parsers": "0.7.27", "@aml-org/amf-custom-validator": "1.7.2", "@aml-org/amf-custom-validator-web": "1.7.2", "ajv": "6.12.6", diff --git a/als-server/shared/src/test/resources/diagnostics/project/api.raml.jsonld b/als-server/shared/src/test/resources/diagnostics/project/api.raml.jsonld index c6edf00bd..8956b7105 100644 --- a/als-server/shared/src/test/resources/diagnostics/project/api.raml.jsonld +++ b/als-server/shared/src/test/resources/diagnostics/project/api.raml.jsonld @@ -5,7 +5,7 @@ "@type": [ "doc:APIContractProcessingData" ], -"apiContract:modelVersion": "3.9.0", +"apiContract:modelVersion": "3.10.0", "doc:transformed": true, "doc:sourceSpec": "RAML 1.0" }, diff --git a/als-server/shared/src/test/resources/diagnostics/project/isolated.raml.jsonld b/als-server/shared/src/test/resources/diagnostics/project/isolated.raml.jsonld index 2aa641f46..6734718e3 100644 --- a/als-server/shared/src/test/resources/diagnostics/project/isolated.raml.jsonld +++ b/als-server/shared/src/test/resources/diagnostics/project/isolated.raml.jsonld @@ -5,7 +5,7 @@ "@type": [ "doc:APIContractProcessingData" ], -"apiContract:modelVersion": "3.9.0", +"apiContract:modelVersion": "3.10.0", "doc:transformed": true, "doc:sourceSpec": "RAML 1.0" }, diff --git a/als-server/shared/src/test/resources/serialization/abstract-declaration/main.jsonld b/als-server/shared/src/test/resources/serialization/abstract-declaration/main.jsonld index 7823e55fd..cc28a924d 100644 --- a/als-server/shared/src/test/resources/serialization/abstract-declaration/main.jsonld +++ b/als-server/shared/src/test/resources/serialization/abstract-declaration/main.jsonld @@ -5,7 +5,7 @@ "@type": [ "doc:APIContractProcessingData" ], -"apiContract:modelVersion": "3.9.0", +"apiContract:modelVersion": "3.10.0", "doc:transformed": true, "doc:sourceSpec": "RAML 1.0" }, @@ -74,7 +74,7 @@ "@type": [ "doc:APIContractProcessingData" ], -"apiContract:modelVersion": "3.9.0", +"apiContract:modelVersion": "3.10.0", "doc:sourceSpec": "RAML 1.0" }, { diff --git a/als-structure/js/package-lock.json b/als-structure/js/package-lock.json index 0f23aed58..2de7ec13e 100644 --- a/als-structure/js/package-lock.json +++ b/als-structure/js/package-lock.json @@ -9,15 +9,15 @@ "version": "1.0.0", "license": "ISC", "dependencies": { - "@aml-org/amf-antlr-parsers": "0.7.25", + "@aml-org/amf-antlr-parsers": "0.7.27", "ajv": "6.12.6", "avro-js": "1.12.0" } }, "node_modules/@aml-org/amf-antlr-parsers": { - "version": "0.7.25", - "resolved": "https://registry.npmjs.org/@aml-org/amf-antlr-parsers/-/amf-antlr-parsers-0.7.25.tgz", - "integrity": "sha512-JEwX1Ja8SFbcYboOEbZ+t//w1sWULGKRV3x0moDpKR+MWjL69FWy484/u0GXHBYdydtbGHM4NcKltYNOaH5Bmw==" + "version": "0.7.27", + "resolved": "https://registry.npmjs.org/@aml-org/amf-antlr-parsers/-/amf-antlr-parsers-0.7.27.tgz", + "integrity": "sha512-TUh9kOweGuL2C8eaA0YRJy6YEMGlGhSUFnrZ7tgBTxLOhDr/Q5PiE4U1tYkvkqc2kBD3cY82ftRcq9nIcFDB0Q==" }, "node_modules/ajv": { "version": "6.12.6", @@ -81,9 +81,9 @@ }, "dependencies": { "@aml-org/amf-antlr-parsers": { - "version": "0.7.25", - "resolved": "https://registry.npmjs.org/@aml-org/amf-antlr-parsers/-/amf-antlr-parsers-0.7.25.tgz", - "integrity": "sha512-JEwX1Ja8SFbcYboOEbZ+t//w1sWULGKRV3x0moDpKR+MWjL69FWy484/u0GXHBYdydtbGHM4NcKltYNOaH5Bmw==" + "version": "0.7.27", + "resolved": "https://registry.npmjs.org/@aml-org/amf-antlr-parsers/-/amf-antlr-parsers-0.7.27.tgz", + "integrity": "sha512-TUh9kOweGuL2C8eaA0YRJy6YEMGlGhSUFnrZ7tgBTxLOhDr/Q5PiE4U1tYkvkqc2kBD3cY82ftRcq9nIcFDB0Q==" }, "ajv": { "version": "6.12.6", diff --git a/als-structure/js/package.json b/als-structure/js/package.json index 164c19843..1676e3613 100644 --- a/als-structure/js/package.json +++ b/als-structure/js/package.json @@ -6,7 +6,7 @@ "test": "echo \"Error: no test specified\" && exit 1" }, "dependencies": { - "@aml-org/amf-antlr-parsers": "0.7.25", + "@aml-org/amf-antlr-parsers": "0.7.27", "ajv": "6.12.6", "avro-js": "1.12.0" }, diff --git a/als-suggestions/js/package-lock.json b/als-suggestions/js/package-lock.json index be106e678..6a4f1c058 100644 --- a/als-suggestions/js/package-lock.json +++ b/als-suggestions/js/package-lock.json @@ -9,15 +9,15 @@ "version": "1.0.0", "license": "ISC", "dependencies": { - "@aml-org/amf-antlr-parsers": "0.7.25", + "@aml-org/amf-antlr-parsers": "0.7.27", "ajv": "6.12.6", "avro-js": "1.12.0" } }, "node_modules/@aml-org/amf-antlr-parsers": { - "version": "0.7.25", - "resolved": "https://registry.npmjs.org/@aml-org/amf-antlr-parsers/-/amf-antlr-parsers-0.7.25.tgz", - "integrity": "sha512-JEwX1Ja8SFbcYboOEbZ+t//w1sWULGKRV3x0moDpKR+MWjL69FWy484/u0GXHBYdydtbGHM4NcKltYNOaH5Bmw==" + "version": "0.7.27", + "resolved": "https://registry.npmjs.org/@aml-org/amf-antlr-parsers/-/amf-antlr-parsers-0.7.27.tgz", + "integrity": "sha512-TUh9kOweGuL2C8eaA0YRJy6YEMGlGhSUFnrZ7tgBTxLOhDr/Q5PiE4U1tYkvkqc2kBD3cY82ftRcq9nIcFDB0Q==" }, "node_modules/ajv": { "version": "6.12.6", @@ -81,9 +81,9 @@ }, "dependencies": { "@aml-org/amf-antlr-parsers": { - "version": "0.7.25", - "resolved": "https://registry.npmjs.org/@aml-org/amf-antlr-parsers/-/amf-antlr-parsers-0.7.25.tgz", - "integrity": "sha512-JEwX1Ja8SFbcYboOEbZ+t//w1sWULGKRV3x0moDpKR+MWjL69FWy484/u0GXHBYdydtbGHM4NcKltYNOaH5Bmw==" + "version": "0.7.27", + "resolved": "https://registry.npmjs.org/@aml-org/amf-antlr-parsers/-/amf-antlr-parsers-0.7.27.tgz", + "integrity": "sha512-TUh9kOweGuL2C8eaA0YRJy6YEMGlGhSUFnrZ7tgBTxLOhDr/Q5PiE4U1tYkvkqc2kBD3cY82ftRcq9nIcFDB0Q==" }, "ajv": { "version": "6.12.6", diff --git a/als-suggestions/js/package.json b/als-suggestions/js/package.json index 3f304ee14..a39fef74f 100644 --- a/als-suggestions/js/package.json +++ b/als-suggestions/js/package.json @@ -6,7 +6,7 @@ "test": "echo \"Error: no test specified\" && exit 1" }, "dependencies": { - "@aml-org/amf-antlr-parsers": "0.7.25", + "@aml-org/amf-antlr-parsers": "0.7.27", "ajv": "6.12.6", "avro-js": "1.12.0" }, diff --git a/dependencies.properties b/dependencies.properties index c9347312c..7946abb65 100644 --- a/dependencies.properties +++ b/dependencies.properties @@ -1,5 +1,5 @@ version=6.4.0-SNAPSHOT -amf=5.6.2 +amf=5.6.3 amf.custom-validator.js=1.7.2 -amf.custom-validator-scalajs=0.6.0 -amf-antlr-parsers=0.7.25 +amf.custom-validator-scalajs=0.6.1 +amf-antlr-parsers=0.7.27 From 366f4920b15dce39b3fd451b0710a795c4c5059b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Tom=C3=A1s=20Lo=20Sardo?= Date: Fri, 25 Oct 2024 12:25:53 -0300 Subject: [PATCH 10/10] Bump to stable version --- dependencies.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.properties b/dependencies.properties index 7946abb65..94a9b7ad2 100644 --- a/dependencies.properties +++ b/dependencies.properties @@ -1,4 +1,4 @@ -version=6.4.0-SNAPSHOT +version=6.3.3 amf=5.6.3 amf.custom-validator.js=1.7.2 amf.custom-validator-scalajs=0.6.1