From 962c8cfc975d3b6016c7691ec9d96885d56de0bb Mon Sep 17 00:00:00 2001 From: arielmirra Date: Fri, 12 Jul 2024 16:49:59 -0300 Subject: [PATCH 1/4] W-16006973: add avro annotations for ALS --- .../avro/parser/domain/AvroEnumParser.scala | 12 +- .../parser/domain/AvroMapShapeParser.scala | 7 +- .../avro/parser/domain/AvroRecordParser.scala | 15 +- .../avro/parser/domain/AvroShapeParser.scala | 2 +- .../parser/domain/AvroUnionShapeParser.scala | 3 +- .../apis/valid/async-2.4-avro-valid.jsonld | 138 +++++++++ .../tck/apis/valid/avro-components.jsonld | 138 +++++++++ .../avro/tck/apis/valid/avro-inline.jsonld | 115 ++++++++ .../cycle/avro/valid/doc-schema.jsonld | 115 ++++++++ .../cycle/avro/valid/enum-schema.jsonld | 115 ++++++++ .../cycle/avro/valid/nested-schema.jsonld | 92 ++++++ .../cycle/avro/valid/non-standar.jsonld | 276 ++++++++++++++++++ .../cycle/avro/valid/person-schema.jsonld | 276 ++++++++++++++++++ .../upanddown/cycle/avro/valid/record.jsonld | 46 +++ .../cycle/avro/valid/test-union-record.jsonld | 23 ++ 15 files changed, 1359 insertions(+), 14 deletions(-) diff --git a/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/spec/avro/parser/domain/AvroEnumParser.scala b/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/spec/avro/parser/domain/AvroEnumParser.scala index 2debf11526..da8cbcc00b 100644 --- a/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/spec/avro/parser/domain/AvroEnumParser.scala +++ b/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/spec/avro/parser/domain/AvroEnumParser.scala @@ -2,7 +2,9 @@ package amf.apicontract.internal.spec.avro.parser.domain import amf.apicontract.internal.spec.avro.parser.context.AvroSchemaContext import amf.core.client.scala.model.DataType -import amf.core.client.scala.model.domain.ScalarNode +import amf.core.client.scala.model.domain.{AmfArray, ScalarNode} +import amf.core.internal.metamodel.domain.ShapeModel +import amf.core.internal.parser.domain.Annotations import amf.core.internal.parser.{YMapOps, YScalarYRead} import amf.shapes.client.scala.model.domain.AnyShape import org.yaml.model._ @@ -18,10 +20,10 @@ class AvroEnumParser(map: YMap)(implicit ctx: AvroSchemaContext) extends AvroTex } override def parseSpecificFields(): Unit = { - map - .key("symbols") - .map(parseSymbols) - .map(shape.withValues) + map.key("symbols").map { entry => + val symbols = parseSymbols(entry) + shape.setWithoutId(ShapeModel.Values, AmfArray(symbols, Annotations(entry.value)), Annotations(entry)) + } } private def parseSymbols(e: YMapEntry): Seq[ScalarNode] = { diff --git a/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/spec/avro/parser/domain/AvroMapShapeParser.scala b/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/spec/avro/parser/domain/AvroMapShapeParser.scala index 8b82c26ae1..2b8adc0c5f 100644 --- a/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/spec/avro/parser/domain/AvroMapShapeParser.scala +++ b/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/spec/avro/parser/domain/AvroMapShapeParser.scala @@ -1,13 +1,16 @@ package amf.apicontract.internal.spec.avro.parser.domain import amf.apicontract.internal.spec.avro.parser.context.AvroSchemaContext +import amf.core.internal.parser.domain.Annotations import amf.shapes.client.scala.model.domain.{AnyShape, NodeShape} +import amf.shapes.internal.domain.metamodel.NodeShapeModel.AdditionalPropertiesSchema import org.yaml.model.YMap case class AvroMapShapeParser(map: YMap)(implicit ctx: AvroSchemaContext) extends AvroCollectionShapeParser[NodeShape](map, "values") { - override val shape: NodeShape = NodeShape(map) - override def setMembers(anyShape: AnyShape): Unit = shape.withAdditionalPropertiesSchema(anyShape) + override val shape: NodeShape = NodeShape(map) + override def setMembers(anyShape: AnyShape): Unit = + shape.setWithoutId(AdditionalPropertiesSchema, anyShape, Annotations(map)) override def parseSpecificFields(): Unit = {} } diff --git a/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/spec/avro/parser/domain/AvroRecordParser.scala b/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/spec/avro/parser/domain/AvroRecordParser.scala index 2884d81488..5deccc2447 100644 --- a/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/spec/avro/parser/domain/AvroRecordParser.scala +++ b/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/spec/avro/parser/domain/AvroRecordParser.scala @@ -1,6 +1,7 @@ package amf.apicontract.internal.spec.avro.parser.domain import amf.apicontract.internal.spec.avro.parser.context.AvroSchemaContext +import amf.core.client.scala.model.domain.AmfArray import amf.core.client.scala.model.domain.extensions.PropertyShape import amf.core.internal.datanode.DataNodeParser import amf.core.internal.metamodel.domain.ShapeModel @@ -9,6 +10,7 @@ import amf.core.internal.parser.YMapOps import amf.core.internal.parser.domain.Annotations import amf.shapes.client.scala.model.domain.{AnyShape, NodeShape} import amf.shapes.internal.domain.metamodel.AnyShapeModel +import amf.shapes.internal.domain.metamodel.NodeShapeModel.Properties import org.yaml.model.{YMap, YMapEntry, YNode} class AvroRecordParser(map: YMap)(implicit ctx: AvroSchemaContext) extends AvroComplexShapeParser(map) { @@ -21,11 +23,17 @@ class AvroRecordParser(map: YMap)(implicit ctx: AvroSchemaContext) extends AvroC private def parseFieldsEntry(e: YMapEntry): Unit = { val fields = e.value.as[Seq[YMap]].flatMap(parseField) - shape.withProperties(fields) + shape.setWithoutId(Properties, AmfArray(fields, Annotations(e.value)), Annotations(e)) } def parseField(map: YMap): Option[PropertyShape] = { - val maybeShape: Option[PropertyShape] = AvroRecordFieldParser(map).parse().map(buildProperty) + val maybeShape = + AvroRecordFieldParser(map) + .parse() + .map { s => + val p = PropertyShape(Annotations(map)).withRange(s) + p.setWithoutId(PropertyShapeModel.Range, s, s.annotations) + } maybeShape.foreach { p => map.key("name", AnyShapeModel.Name in p) map.key("aliases", AnyShapeModel.Aliases in p) @@ -41,9 +49,6 @@ class AvroRecordParser(map: YMap)(implicit ctx: AvroSchemaContext) extends AvroC } maybeShape } - - private def buildProperty(anyShape: AnyShape): PropertyShape = - PropertyShape(Annotations.virtual()).withName("field").withRange(anyShape) } case class AvroRecordFieldParser(map: YMap)(implicit ctx: AvroSchemaContext) extends AvroShapeParser(map) { diff --git a/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/spec/avro/parser/domain/AvroShapeParser.scala b/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/spec/avro/parser/domain/AvroShapeParser.scala index 81eaa23277..e82164d97f 100644 --- a/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/spec/avro/parser/domain/AvroShapeParser.scala +++ b/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/spec/avro/parser/domain/AvroShapeParser.scala @@ -21,7 +21,7 @@ class AvroShapeParser(map: YMap)(implicit ctx: AvroSchemaContext) extends AvroKe // todo: should validate invalid type when using the AVRO Validator (None, "invalid avro type") } - maybeShape.map(_.annotations += AVROSchemaType(avroType)) + maybeShape.map(_.annotations += AVROSchemaType(avroType)) // avroType = record, enum, fixed, array, map, etc. maybeShape } diff --git a/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/spec/avro/parser/domain/AvroUnionShapeParser.scala b/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/spec/avro/parser/domain/AvroUnionShapeParser.scala index 6d1b62a2db..f13bbb5033 100644 --- a/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/spec/avro/parser/domain/AvroUnionShapeParser.scala +++ b/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/spec/avro/parser/domain/AvroUnionShapeParser.scala @@ -1,6 +1,7 @@ package amf.apicontract.internal.spec.avro.parser.domain import amf.apicontract.internal.spec.avro.parser.context.AvroSchemaContext +import amf.core.internal.parser.domain.Annotations import amf.shapes.client.scala.model.domain.UnionShape import org.yaml.model.{YMap, YNode} @@ -10,6 +11,6 @@ case class AvroUnionShapeParser(members: Seq[YNode], node: YNode)(implicit ctx: override def parseSpecificFields(): Unit = { val parsedMembers = members.map(node => AvroTextParser(node).parse()) - shape.withAnyOf(parsedMembers) + shape.withAnyOf(parsedMembers, Annotations(node)) } } diff --git a/amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.jsonld b/amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.jsonld index ca2035d186..7ee147b433 100644 --- a/amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.jsonld +++ b/amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.jsonld @@ -189,6 +189,29 @@ { "@value": "name" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/name/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/name/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "string" + } + ] + } + ] + } ] }, { @@ -370,6 +393,29 @@ } ] } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/age/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/age/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "union" + } + ] + } + ] + } ] }, { @@ -560,6 +606,29 @@ { "@value": "favoriteProgrammingLanguage" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/favoriteProgrammingLanguage/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/favoriteProgrammingLanguage/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "enum" + } + ] + } + ] + } ] }, { @@ -633,6 +702,29 @@ { "@value": "zipcode" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/address/shape/Address/property/property/zipcode/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/address/shape/Address/property/property/zipcode/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "int" + } + ] + } + ] + } ] } ], @@ -670,6 +762,29 @@ { "@value": "address" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/address/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/address/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "record" + } + ] + } + ] + } ] }, { @@ -724,6 +839,29 @@ { "@value": "someid" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/someid/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/someid/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "string" + } + ] + } + ] + } ] } ], diff --git a/amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.jsonld b/amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.jsonld index 75644d361d..45e7073327 100644 --- a/amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.jsonld +++ b/amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.jsonld @@ -189,6 +189,29 @@ { "@value": "name" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/name/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/name/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "string" + } + ] + } + ] + } ] }, { @@ -370,6 +393,29 @@ } ] } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/age/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/age/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "union" + } + ] + } + ] + } ] }, { @@ -560,6 +606,29 @@ { "@value": "favoriteProgrammingLanguage" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/favoriteProgrammingLanguage/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/favoriteProgrammingLanguage/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "enum" + } + ] + } + ] + } ] }, { @@ -633,6 +702,29 @@ { "@value": "zipcode" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/address/shape/Address/property/property/zipcode/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/address/shape/Address/property/property/zipcode/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "int" + } + ] + } + ] + } ] } ], @@ -670,6 +762,29 @@ { "@value": "address" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/address/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/address/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "record" + } + ] + } + ] + } ] }, { @@ -724,6 +839,29 @@ { "@value": "someid" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/someid/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/someid/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "string" + } + ] + } + ] + } ] } ], diff --git a/amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-inline.jsonld b/amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-inline.jsonld index ba87f85183..e8685c847b 100644 --- a/amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-inline.jsonld +++ b/amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-inline.jsonld @@ -136,6 +136,29 @@ { "@value": "name" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-inline.yaml#/async-api/endpoint/mychannel/supportedOperation/publish/expects/request/payload/default/shape/Person/property/property/name/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-inline.yaml#/async-api/endpoint/mychannel/supportedOperation/publish/expects/request/payload/default/shape/Person/property/property/name/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "string" + } + ] + } + ] + } ] }, { @@ -317,6 +340,29 @@ } ] } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-inline.yaml#/async-api/endpoint/mychannel/supportedOperation/publish/expects/request/payload/default/shape/Person/property/property/age/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-inline.yaml#/async-api/endpoint/mychannel/supportedOperation/publish/expects/request/payload/default/shape/Person/property/property/age/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "union" + } + ] + } + ] + } ] }, { @@ -482,6 +528,29 @@ { "@value": "favoriteProgrammingLanguage" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-inline.yaml#/async-api/endpoint/mychannel/supportedOperation/publish/expects/request/payload/default/shape/Person/property/property/favoriteProgrammingLanguage/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-inline.yaml#/async-api/endpoint/mychannel/supportedOperation/publish/expects/request/payload/default/shape/Person/property/property/favoriteProgrammingLanguage/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "enum" + } + ] + } + ] + } ] }, { @@ -555,6 +624,29 @@ { "@value": "zipcode" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-inline.yaml#/async-api/endpoint/mychannel/supportedOperation/publish/expects/request/payload/default/shape/Person/property/property/address/shape/Address/property/property/zipcode/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-inline.yaml#/async-api/endpoint/mychannel/supportedOperation/publish/expects/request/payload/default/shape/Person/property/property/address/shape/Address/property/property/zipcode/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "int" + } + ] + } + ] + } ] } ], @@ -592,6 +684,29 @@ { "@value": "address" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-inline.yaml#/async-api/endpoint/mychannel/supportedOperation/publish/expects/request/payload/default/shape/Person/property/property/address/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-inline.yaml#/async-api/endpoint/mychannel/supportedOperation/publish/expects/request/payload/default/shape/Person/property/property/address/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "record" + } + ] + } + ] + } ] } ], diff --git a/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/doc-schema.jsonld b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/doc-schema.jsonld index e0c12b6e50..b28478b9a0 100644 --- a/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/doc-schema.jsonld +++ b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/doc-schema.jsonld @@ -95,6 +95,29 @@ { "@value": "Unique identifier for this specific event" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/doc-schema.json#/shape/ConnectionRequested/property/property/metadata/shape/EventMetadata/property/property/id/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/doc-schema.json#/shape/ConnectionRequested/property/property/metadata/shape/EventMetadata/property/property/id/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "string" + } + ] + } + ] + } ] }, { @@ -154,6 +177,29 @@ { "@value": "Instant the event took place" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/doc-schema.json#/shape/ConnectionRequested/property/property/metadata/shape/EventMetadata/property/property/timestamp/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/doc-schema.json#/shape/ConnectionRequested/property/property/metadata/shape/EventMetadata/property/property/timestamp/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "long" + } + ] + } + ] + } ] } ], @@ -206,6 +252,29 @@ { "@value": "Metadata about the event." } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/doc-schema.json#/shape/ConnectionRequested/property/property/metadata/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/doc-schema.json#/shape/ConnectionRequested/property/property/metadata/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "record" + } + ] + } + ] + } ] }, { @@ -265,6 +334,29 @@ { "@value": "Encrypted auth_code received when user authorizes the app." } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/doc-schema.json#/shape/ConnectionRequested/property/property/auth_code/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/doc-schema.json#/shape/ConnectionRequested/property/property/auth_code/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "string" + } + ] + } + ] + } ] }, { @@ -324,6 +416,29 @@ { "@value": "ID of the user who triggered this event." } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/doc-schema.json#/shape/ConnectionRequested/property/property/triggered_by/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/doc-schema.json#/shape/ConnectionRequested/property/property/triggered_by/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "string" + } + ] + } + ] + } ] } ], diff --git a/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/enum-schema.jsonld b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/enum-schema.jsonld index 0a567f6cbd..c9ee516142 100644 --- a/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/enum-schema.jsonld +++ b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/enum-schema.jsonld @@ -71,6 +71,29 @@ { "@value": "name" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/enum-schema.json#/shape/default-node/property/property/name/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/enum-schema.json#/shape/default-node/property/property/name/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "string" + } + ] + } + ] + } ] }, { @@ -252,6 +275,29 @@ } ] } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/enum-schema.json#/shape/default-node/property/property/age/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/enum-schema.json#/shape/default-node/property/property/age/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "union" + } + ] + } + ] + } ] }, { @@ -417,6 +463,29 @@ { "@value": "favoriteProgrammingLanguage" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/enum-schema.json#/shape/default-node/property/property/favoriteProgrammingLanguage/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/enum-schema.json#/shape/default-node/property/property/favoriteProgrammingLanguage/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "enum" + } + ] + } + ] + } ] }, { @@ -490,6 +559,29 @@ { "@value": "zipcode" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/enum-schema.json#/shape/default-node/property/property/address/shape/Address/property/property/zipcode/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/enum-schema.json#/shape/default-node/property/property/address/shape/Address/property/property/zipcode/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "int" + } + ] + } + ] + } ] } ], @@ -527,6 +619,29 @@ { "@value": "address" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/enum-schema.json#/shape/default-node/property/property/address/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/enum-schema.json#/shape/default-node/property/property/address/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "record" + } + ] + } + ] + } ] } ], diff --git a/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.jsonld b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.jsonld index 2c5e04bbc1..cd174ba283 100644 --- a/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.jsonld +++ b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.jsonld @@ -123,6 +123,29 @@ } ] } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.json#/shape/TestRecordWithMapsAndArrays/property/property/arr/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.json#/shape/TestRecordWithMapsAndArrays/property/property/arr/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "array" + } + ] + } + ] + } ] }, { @@ -204,6 +227,29 @@ } ] } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.json#/shape/TestRecordWithMapsAndArrays/property/property/map/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.json#/shape/TestRecordWithMapsAndArrays/property/property/map/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "map" + } + ] + } + ] + } ] }, { @@ -328,6 +374,29 @@ { "@value": "nested_arr" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.json#/shape/TestRecordWithMapsAndArrays/property/property/nested_arr/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.json#/shape/TestRecordWithMapsAndArrays/property/property/nested_arr/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "array" + } + ] + } + ] + } ] }, { @@ -389,6 +458,29 @@ { "@value": "nested_map" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.json#/shape/TestRecordWithMapsAndArrays/property/property/nested_map/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.json#/shape/TestRecordWithMapsAndArrays/property/property/nested_map/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "map" + } + ] + } + ] + } ] } ], diff --git a/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.jsonld b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.jsonld index 571b8041c7..6c9e990487 100644 --- a/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.jsonld +++ b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.jsonld @@ -71,6 +71,29 @@ { "@value": "name" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/name/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/name/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "string" + } + ] + } + ] + } ] }, { @@ -125,6 +148,29 @@ { "@value": "serialNo" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/serialNo/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/serialNo/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "string" + } + ] + } + ] + } ] }, { @@ -306,6 +352,29 @@ } ] } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/email/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/email/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "union" + } + ] + } + ] + } ] }, { @@ -487,6 +556,29 @@ } ] } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/age/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/age/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "union" + } + ] + } + ] + } ] }, { @@ -677,6 +769,29 @@ { "@value": "favoriteProgrammingLanguage" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/favoriteProgrammingLanguage/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/favoriteProgrammingLanguage/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "enum" + } + ] + } + ] + } ] }, { @@ -766,6 +881,29 @@ { "@value": "certifications" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/certifications/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/certifications/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "array" + } + ] + } + ] + } ] }, { @@ -839,6 +977,29 @@ { "@value": "zipcode" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/address/shape/Address/property/property/zipcode/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/address/shape/Address/property/property/zipcode/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "int" + } + ] + } + ] + } ] }, { @@ -1020,6 +1181,29 @@ } ] } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/address/shape/Address/property/property/country/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/address/shape/Address/property/property/country/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "union" + } + ] + } + ] + } ] } ], @@ -1057,6 +1241,29 @@ { "@value": "address" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/address/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/address/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "record" + } + ] + } + ] + } ] }, { @@ -1111,6 +1318,29 @@ { "@value": "weight" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/weight/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/weight/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "float" + } + ] + } + ] + } ] }, { @@ -1165,6 +1395,29 @@ { "@value": "height" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/height/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/height/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "double" + } + ] + } + ] + } ] }, { @@ -1219,6 +1472,29 @@ { "@value": "someid" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/someid/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/someid/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "string" + } + ] + } + ] + } ] } ], diff --git a/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.jsonld b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.jsonld index 904cf03495..2d69fd616a 100644 --- a/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.jsonld +++ b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.jsonld @@ -71,6 +71,29 @@ { "@value": "name" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/name/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/name/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "string" + } + ] + } + ] + } ] }, { @@ -125,6 +148,29 @@ { "@value": "serialNo" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/serialNo/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/serialNo/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "string" + } + ] + } + ] + } ] }, { @@ -306,6 +352,29 @@ } ] } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/email/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/email/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "union" + } + ] + } + ] + } ] }, { @@ -487,6 +556,29 @@ } ] } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/age/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/age/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "union" + } + ] + } + ] + } ] }, { @@ -677,6 +769,29 @@ { "@value": "favoriteProgrammingLanguage" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/favoriteProgrammingLanguage/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/favoriteProgrammingLanguage/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "enum" + } + ] + } + ] + } ] }, { @@ -766,6 +881,29 @@ { "@value": "certifications" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/certifications/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/certifications/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "array" + } + ] + } + ] + } ] }, { @@ -839,6 +977,29 @@ { "@value": "zipcode" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/address/shape/Address/property/property/zipcode/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/address/shape/Address/property/property/zipcode/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "int" + } + ] + } + ] + } ] }, { @@ -1020,6 +1181,29 @@ } ] } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/address/shape/Address/property/property/country/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/address/shape/Address/property/property/country/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "union" + } + ] + } + ] + } ] } ], @@ -1057,6 +1241,29 @@ { "@value": "address" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/address/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/address/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "record" + } + ] + } + ] + } ] }, { @@ -1111,6 +1318,29 @@ { "@value": "weight" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/weight/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/weight/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "float" + } + ] + } + ] + } ] }, { @@ -1165,6 +1395,29 @@ { "@value": "height" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/height/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/height/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "double" + } + ] + } + ] + } ] }, { @@ -1219,6 +1472,29 @@ { "@value": "someid" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/someid/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/someid/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "string" + } + ] + } + ] + } ] } ], diff --git a/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/record.jsonld b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/record.jsonld index 6b764e9f24..63bb16ddba 100644 --- a/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/record.jsonld +++ b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/record.jsonld @@ -101,6 +101,29 @@ } ] } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/record.json#/shape/LongList/property/property/value/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/record.json#/shape/LongList/property/property/value/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "long" + } + ] + } + ] + } ] }, { @@ -302,6 +325,29 @@ } ] } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/record.json#/shape/LongList/property/property/next/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/record.json#/shape/LongList/property/property/next/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "union" + } + ] + } + ] + } ] } ], diff --git a/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/test-union-record.jsonld b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/test-union-record.jsonld index ac7cc539c4..bb3244bf7f 100644 --- a/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/test-union-record.jsonld +++ b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/test-union-record.jsonld @@ -198,6 +198,29 @@ } ] } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/test-union-record.json#/shape/TestUnionRecord/property/property/amount/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/test-union-record.json#/shape/TestUnionRecord/property/property/amount/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "union" + } + ] + } + ] + } ] } ], From 3b28681d361a17c8b29a67d74cd5e790435c46b3 Mon Sep 17 00:00:00 2001 From: arielmirra Date: Tue, 16 Jul 2024 11:24:34 -0300 Subject: [PATCH 2/4] W-16006973: add avro type annotation to propertyShapes (a record field) --- .../domain/AvroComplexShapeParser.scala | 4 + .../avro/parser/domain/AvroRecordParser.scala | 6 +- .../apis/valid/async-2.4-avro-valid.jsonld | 78 +++++++++ .../tck/apis/valid/avro-components.jsonld | 78 +++++++++ .../avro/tck/apis/valid/avro-inline.jsonld | 65 ++++++++ .../cycle/avro/valid/doc-schema.jsonld | 65 ++++++++ .../cycle/avro/valid/enum-schema.jsonld | 65 ++++++++ .../cycle/avro/valid/nested-schema.jsonld | 52 ++++++ .../cycle/avro/valid/non-standar.jsonld | 156 ++++++++++++++++++ .../cycle/avro/valid/person-schema.jsonld | 156 ++++++++++++++++++ .../upanddown/cycle/avro/valid/record.jsonld | 26 +++ .../cycle/avro/valid/test-union-record.jsonld | 13 ++ .../scala/amf/avro/AvroSchemaTCKTest.scala | 2 +- 13 files changed, 764 insertions(+), 2 deletions(-) diff --git a/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/spec/avro/parser/domain/AvroComplexShapeParser.scala b/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/spec/avro/parser/domain/AvroComplexShapeParser.scala index c81e1c625f..efb9c8dcf9 100644 --- a/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/spec/avro/parser/domain/AvroComplexShapeParser.scala +++ b/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/spec/avro/parser/domain/AvroComplexShapeParser.scala @@ -1,11 +1,13 @@ package amf.apicontract.internal.spec.avro.parser.domain import amf.apicontract.internal.spec.avro.parser.context.AvroSchemaContext +import amf.core.client.scala.model.domain.Shape import amf.core.internal.datanode.DataNodeParser import amf.core.internal.metamodel.domain.ShapeModel import amf.core.internal.parser.YMapOps import amf.core.internal.parser.domain.Annotations import amf.shapes.client.scala.model.domain.AnyShape +import amf.shapes.internal.annotations.AVROSchemaType import amf.shapes.internal.domain.metamodel.AnyShapeModel import amf.shapes.internal.spec.common.parser.QuickFieldParserOps import org.yaml.model._ @@ -63,4 +65,6 @@ trait AvroKeyExtractor { def isPrimitive: Boolean = Seq("null", "boolean", "int", "long", "float", "double", "bytes", "string").contains(value) } + + def getAvroType(shape: Shape): Option[AVROSchemaType] = shape.annotations.find(classOf[AVROSchemaType]) } diff --git a/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/spec/avro/parser/domain/AvroRecordParser.scala b/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/spec/avro/parser/domain/AvroRecordParser.scala index 5deccc2447..04614779fa 100644 --- a/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/spec/avro/parser/domain/AvroRecordParser.scala +++ b/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/spec/avro/parser/domain/AvroRecordParser.scala @@ -31,13 +31,17 @@ class AvroRecordParser(map: YMap)(implicit ctx: AvroSchemaContext) extends AvroC AvroRecordFieldParser(map) .parse() .map { s => - val p = PropertyShape(Annotations(map)).withRange(s) + // add the map annotations + the avro type annotation to the PropertyShape wrapper + var ann = Annotations(map) + getAvroType(s).foreach(avroTypeAnnotation => ann = ann += avroTypeAnnotation) + val p = PropertyShape(ann).withRange(s) p.setWithoutId(PropertyShapeModel.Range, s, s.annotations) } maybeShape.foreach { p => map.key("name", AnyShapeModel.Name in p) map.key("aliases", AnyShapeModel.Aliases in p) map.key("doc", AnyShapeModel.Description in p) + // todo: change to new field Order (being a string) map.key("order", PropertyShapeModel.SerializationOrder in p) map.key( "default", diff --git a/amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.jsonld b/amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.jsonld index 7ee147b433..2dcb89ce52 100644 --- a/amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.jsonld +++ b/amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.jsonld @@ -197,6 +197,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/name/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/name" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "string" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/name/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -401,6 +414,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/age/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/age" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "union" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/age/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -614,6 +640,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/favoriteProgrammingLanguage/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/favoriteProgrammingLanguage" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "enum" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/favoriteProgrammingLanguage/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -710,6 +749,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/address/shape/Address/property/property/zipcode/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/address/shape/Address/property/property/zipcode" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "int" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/address/shape/Address/property/property/zipcode/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -770,6 +822,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/address/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/address" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "record" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/address/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -847,6 +912,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/someid/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/someid" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "string" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/async-2.4-avro-valid.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/someid/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ diff --git a/amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.jsonld b/amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.jsonld index 45e7073327..f03e47302b 100644 --- a/amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.jsonld +++ b/amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.jsonld @@ -197,6 +197,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/name/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/name" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "string" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/name/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -401,6 +414,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/age/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/age" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "union" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/age/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -614,6 +640,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/favoriteProgrammingLanguage/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/favoriteProgrammingLanguage" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "enum" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/favoriteProgrammingLanguage/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -710,6 +749,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/address/shape/Address/property/property/zipcode/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/address/shape/Address/property/property/zipcode" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "int" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/address/shape/Address/property/property/zipcode/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -770,6 +822,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/address/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/address" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "record" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/address/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -847,6 +912,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/someid/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/someid" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "string" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-components.yaml#/declares/msg/testMessage/payload/default/shape/Person/property/property/someid/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ diff --git a/amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-inline.jsonld b/amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-inline.jsonld index e8685c847b..3244216d62 100644 --- a/amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-inline.jsonld +++ b/amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-inline.jsonld @@ -144,6 +144,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-inline.yaml#/async-api/endpoint/mychannel/supportedOperation/publish/expects/request/payload/default/shape/Person/property/property/name/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-inline.yaml#/async-api/endpoint/mychannel/supportedOperation/publish/expects/request/payload/default/shape/Person/property/property/name" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "string" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-inline.yaml#/async-api/endpoint/mychannel/supportedOperation/publish/expects/request/payload/default/shape/Person/property/property/name/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -348,6 +361,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-inline.yaml#/async-api/endpoint/mychannel/supportedOperation/publish/expects/request/payload/default/shape/Person/property/property/age/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-inline.yaml#/async-api/endpoint/mychannel/supportedOperation/publish/expects/request/payload/default/shape/Person/property/property/age" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "union" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-inline.yaml#/async-api/endpoint/mychannel/supportedOperation/publish/expects/request/payload/default/shape/Person/property/property/age/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -536,6 +562,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-inline.yaml#/async-api/endpoint/mychannel/supportedOperation/publish/expects/request/payload/default/shape/Person/property/property/favoriteProgrammingLanguage/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-inline.yaml#/async-api/endpoint/mychannel/supportedOperation/publish/expects/request/payload/default/shape/Person/property/property/favoriteProgrammingLanguage" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "enum" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-inline.yaml#/async-api/endpoint/mychannel/supportedOperation/publish/expects/request/payload/default/shape/Person/property/property/favoriteProgrammingLanguage/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -632,6 +671,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-inline.yaml#/async-api/endpoint/mychannel/supportedOperation/publish/expects/request/payload/default/shape/Person/property/property/address/shape/Address/property/property/zipcode/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-inline.yaml#/async-api/endpoint/mychannel/supportedOperation/publish/expects/request/payload/default/shape/Person/property/property/address/shape/Address/property/property/zipcode" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "int" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-inline.yaml#/async-api/endpoint/mychannel/supportedOperation/publish/expects/request/payload/default/shape/Person/property/property/address/shape/Address/property/property/zipcode/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -692,6 +744,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-inline.yaml#/async-api/endpoint/mychannel/supportedOperation/publish/expects/request/payload/default/shape/Person/property/property/address/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-inline.yaml#/async-api/endpoint/mychannel/supportedOperation/publish/expects/request/payload/default/shape/Person/property/property/address" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "record" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/avro/tck/apis/valid/avro-inline.yaml#/async-api/endpoint/mychannel/supportedOperation/publish/expects/request/payload/default/shape/Person/property/property/address/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ diff --git a/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/doc-schema.jsonld b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/doc-schema.jsonld index b28478b9a0..aa4a559e09 100644 --- a/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/doc-schema.jsonld +++ b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/doc-schema.jsonld @@ -103,6 +103,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/doc-schema.json#/shape/ConnectionRequested/property/property/metadata/shape/EventMetadata/property/property/id/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/doc-schema.json#/shape/ConnectionRequested/property/property/metadata/shape/EventMetadata/property/property/id" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "string" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/doc-schema.json#/shape/ConnectionRequested/property/property/metadata/shape/EventMetadata/property/property/id/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -185,6 +198,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/doc-schema.json#/shape/ConnectionRequested/property/property/metadata/shape/EventMetadata/property/property/timestamp/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/doc-schema.json#/shape/ConnectionRequested/property/property/metadata/shape/EventMetadata/property/property/timestamp" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "long" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/doc-schema.json#/shape/ConnectionRequested/property/property/metadata/shape/EventMetadata/property/property/timestamp/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -260,6 +286,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/doc-schema.json#/shape/ConnectionRequested/property/property/metadata/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/doc-schema.json#/shape/ConnectionRequested/property/property/metadata" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "record" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/doc-schema.json#/shape/ConnectionRequested/property/property/metadata/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -342,6 +381,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/doc-schema.json#/shape/ConnectionRequested/property/property/auth_code/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/doc-schema.json#/shape/ConnectionRequested/property/property/auth_code" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "string" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/doc-schema.json#/shape/ConnectionRequested/property/property/auth_code/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -424,6 +476,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/doc-schema.json#/shape/ConnectionRequested/property/property/triggered_by/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/doc-schema.json#/shape/ConnectionRequested/property/property/triggered_by" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "string" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/doc-schema.json#/shape/ConnectionRequested/property/property/triggered_by/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ diff --git a/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/enum-schema.jsonld b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/enum-schema.jsonld index c9ee516142..f23395ca9a 100644 --- a/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/enum-schema.jsonld +++ b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/enum-schema.jsonld @@ -79,6 +79,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/enum-schema.json#/shape/default-node/property/property/name/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/enum-schema.json#/shape/default-node/property/property/name" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "string" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/enum-schema.json#/shape/default-node/property/property/name/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -283,6 +296,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/enum-schema.json#/shape/default-node/property/property/age/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/enum-schema.json#/shape/default-node/property/property/age" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "union" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/enum-schema.json#/shape/default-node/property/property/age/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -471,6 +497,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/enum-schema.json#/shape/default-node/property/property/favoriteProgrammingLanguage/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/enum-schema.json#/shape/default-node/property/property/favoriteProgrammingLanguage" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "enum" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/enum-schema.json#/shape/default-node/property/property/favoriteProgrammingLanguage/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -567,6 +606,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/enum-schema.json#/shape/default-node/property/property/address/shape/Address/property/property/zipcode/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/enum-schema.json#/shape/default-node/property/property/address/shape/Address/property/property/zipcode" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "int" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/enum-schema.json#/shape/default-node/property/property/address/shape/Address/property/property/zipcode/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -627,6 +679,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/enum-schema.json#/shape/default-node/property/property/address/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/enum-schema.json#/shape/default-node/property/property/address" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "record" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/enum-schema.json#/shape/default-node/property/property/address/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ diff --git a/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.jsonld b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.jsonld index cd174ba283..29fb551656 100644 --- a/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.jsonld +++ b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.jsonld @@ -131,6 +131,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.json#/shape/TestRecordWithMapsAndArrays/property/property/arr/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.json#/shape/TestRecordWithMapsAndArrays/property/property/arr" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "array" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.json#/shape/TestRecordWithMapsAndArrays/property/property/arr/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -235,6 +248,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.json#/shape/TestRecordWithMapsAndArrays/property/property/map/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.json#/shape/TestRecordWithMapsAndArrays/property/property/map" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "map" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.json#/shape/TestRecordWithMapsAndArrays/property/property/map/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -382,6 +408,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.json#/shape/TestRecordWithMapsAndArrays/property/property/nested_arr/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.json#/shape/TestRecordWithMapsAndArrays/property/property/nested_arr" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "array" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.json#/shape/TestRecordWithMapsAndArrays/property/property/nested_arr/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -466,6 +505,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.json#/shape/TestRecordWithMapsAndArrays/property/property/nested_map/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.json#/shape/TestRecordWithMapsAndArrays/property/property/nested_map" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "map" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.json#/shape/TestRecordWithMapsAndArrays/property/property/nested_map/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ diff --git a/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.jsonld b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.jsonld index 6c9e990487..a478053bd5 100644 --- a/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.jsonld +++ b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.jsonld @@ -79,6 +79,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/name/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/name" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "string" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/name/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -156,6 +169,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/serialNo/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/serialNo" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "string" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/serialNo/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -360,6 +386,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/email/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/email" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "union" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/email/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -564,6 +603,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/age/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/age" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "union" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/age/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -777,6 +829,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/favoriteProgrammingLanguage/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/favoriteProgrammingLanguage" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "enum" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/favoriteProgrammingLanguage/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -889,6 +954,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/certifications/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/certifications" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "array" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/certifications/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -985,6 +1063,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/address/shape/Address/property/property/zipcode/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/address/shape/Address/property/property/zipcode" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "int" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/address/shape/Address/property/property/zipcode/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -1189,6 +1280,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/address/shape/Address/property/property/country/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/address/shape/Address/property/property/country" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "union" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/address/shape/Address/property/property/country/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -1249,6 +1353,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/address/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/address" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "record" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/address/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -1326,6 +1443,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/weight/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/weight" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "float" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/weight/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -1403,6 +1533,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/height/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/height" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "double" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/height/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -1480,6 +1623,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/someid/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/someid" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "string" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/non-standar.json#/shape/Person/property/property/someid/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ diff --git a/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.jsonld b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.jsonld index 2d69fd616a..30292740ae 100644 --- a/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.jsonld +++ b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.jsonld @@ -79,6 +79,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/name/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/name" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "string" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/name/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -156,6 +169,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/serialNo/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/serialNo" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "string" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/serialNo/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -360,6 +386,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/email/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/email" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "union" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/email/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -564,6 +603,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/age/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/age" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "union" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/age/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -777,6 +829,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/favoriteProgrammingLanguage/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/favoriteProgrammingLanguage" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "enum" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/favoriteProgrammingLanguage/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -889,6 +954,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/certifications/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/certifications" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "array" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/certifications/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -985,6 +1063,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/address/shape/Address/property/property/zipcode/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/address/shape/Address/property/property/zipcode" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "int" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/address/shape/Address/property/property/zipcode/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -1189,6 +1280,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/address/shape/Address/property/property/country/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/address/shape/Address/property/property/country" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "union" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/address/shape/Address/property/property/country/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -1249,6 +1353,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/address/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/address" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "record" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/address/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -1326,6 +1443,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/weight/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/weight" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "float" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/weight/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -1403,6 +1533,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/height/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/height" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "double" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/height/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -1480,6 +1623,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/someid/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/someid" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "string" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/person-schema.json#/shape/Person/property/property/someid/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ diff --git a/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/record.jsonld b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/record.jsonld index 63bb16ddba..761ddcf03d 100644 --- a/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/record.jsonld +++ b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/record.jsonld @@ -109,6 +109,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/record.json#/shape/LongList/property/property/value/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/record.json#/shape/LongList/property/property/value" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "long" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/record.json#/shape/LongList/property/property/value/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ @@ -333,6 +346,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/record.json#/shape/LongList/property/property/next/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/record.json#/shape/LongList/property/property/next" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "union" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/record.json#/shape/LongList/property/property/next/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ diff --git a/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/test-union-record.jsonld b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/test-union-record.jsonld index bb3244bf7f..dcb8b64406 100644 --- a/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/test-union-record.jsonld +++ b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/test-union-record.jsonld @@ -206,6 +206,19 @@ "http://a.ml/vocabularies/document-source-maps#SourceMap" ], "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/test-union-record.json#/shape/TestUnionRecord/property/property/amount/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/test-union-record.json#/shape/TestUnionRecord/property/property/amount" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "union" + } + ] + }, { "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/test-union-record.json#/shape/TestUnionRecord/property/property/amount/source-map/avro-schema/element_0", "http://a.ml/vocabularies/document-source-maps#element": [ diff --git a/amf-cli/shared/src/test/scala/amf/avro/AvroSchemaTCKTest.scala b/amf-cli/shared/src/test/scala/amf/avro/AvroSchemaTCKTest.scala index 547ddea50c..dacfce1af7 100644 --- a/amf-cli/shared/src/test/scala/amf/avro/AvroSchemaTCKTest.scala +++ b/amf-cli/shared/src/test/scala/amf/avro/AvroSchemaTCKTest.scala @@ -21,7 +21,7 @@ class AvroSchemaValidTCKTest extends AvroSchemaCycleTest { } test("array with an schema in items field") { - cycle("array-with-items-schema.json", "array-with-items-schema.jsonld", AvroHint, AmfJsonHint) + cycle("record.json", "record.jsonld", AvroHint, AmfJsonHint) } override def renderOptions(): RenderOptions = RenderOptions().withoutFlattenedJsonLd.withPrettyPrint From 3bfcc0a2200b021942c270a68187cf83d99301c5 Mon Sep 17 00:00:00 2001 From: arielmirra Date: Tue, 16 Jul 2024 11:25:13 -0300 Subject: [PATCH 3/4] W-16006973: add avro schema with all possible schemas in the same file --- .../upanddown/cycle/avro/valid/all-types.json | 104 + .../cycle/avro/valid/all-types.jsonld | 1960 +++++++++++++++++ 2 files changed, 2064 insertions(+) create mode 100644 amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json create mode 100644 amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.jsonld diff --git a/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json new file mode 100644 index 0000000000..531bb52c67 --- /dev/null +++ b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json @@ -0,0 +1,104 @@ +{ + "type": "record", + "name": "AllTypes", + "namespace": "root", + "aliases": [ + "EveryTypeInTheSameSchema" + ], + "doc": "this schema contains every possible type you can declare in avro inside it's fields", + "fields": [ + { + "name": "boolean-primitive-type", + "namespace": "primitives", + "doc": "this is a documentation for the boolean primitive type", + "type": "boolean", + "default": false + }, + { + "name": "int-primitive-type", + "namespace": "primitives", + "doc": "this is a documentation for the int primitive type", + "type": "int", + "default": 123 + }, + { + "name": "long-primitive-type", + "namespace": "primitives", + "doc": "this is a documentation for the long primitive type", + "type": "long", + "default": 123 + }, + { + "name": "float-primitive-type", + "namespace": "primitives", + "doc": "this is a documentation for the float primitive type", + "type": "float", + "default": 1.0 + }, + { + "name": "double-primitive-type", + "namespace": "primitives", + "doc": "this is a documentation for the double primitive type", + "type": "double", + "default": 1.0 + }, + { + "name": "bytes-primitive-type", + "namespace": "primitives", + "doc": "this is a documentation for the bytes primitive type", + "type": "bytes", + "default": "\u00FF" + }, + { + "name": "string-primitive-type", + "namespace": "primitives", + "doc": "this is a documentation for the string primitive type", + "type": "string", + "default": "foo" + }, + { + "name": "union", + "doc": "this is a documentation for the union type with recursive element", + "namespace": "unions", + "type": [ + "null", + "LongList" + ], + "default": null + }, + { + "type": "array", + "items": "long", + "default": [] + }, + { + "type": "array", + "items": { + "type": "array", + "items": "string" + }, + "default": [] + }, + { + "type": "enum", + "name": "Suit", + "symbols": [ + "SPADES", + "HEARTS", + "DIAMONDS", + "CLUBS" + ], + "default": "SPADES" + }, + { + "type": "fixed", + "size": 16, + "name": "md5" + }, + { + "type": "map", + "values": "long", + "default": {} + } + ] +} diff --git a/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.jsonld b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.jsonld new file mode 100644 index 0000000000..8f60fa8089 --- /dev/null +++ b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.jsonld @@ -0,0 +1,1960 @@ +[ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json", + "@type": [ + "http://a.ml/vocabularies/document#AvroSchemaDocumentModel", + "http://a.ml/vocabularies/document#Document", + "http://a.ml/vocabularies/document#Fragment", + "http://a.ml/vocabularies/document#Module", + "http://a.ml/vocabularies/document#Unit" + ], + "http://a.ml/vocabularies/document#encodes": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes", + "@type": [ + "http://www.w3.org/ns/shacl#NodeShape", + "http://a.ml/vocabularies/shapes#AnyShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://www.w3.org/ns/shacl#property": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/boolean-primitive-type", + "@type": [ + "http://www.w3.org/ns/shacl#PropertyShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://a.ml/vocabularies/shapes#range": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/boolean-primitive-type/scalar/default-scalar", + "@type": [ + "http://a.ml/vocabularies/shapes#ScalarShape", + "http://a.ml/vocabularies/shapes#AnyShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://www.w3.org/ns/shacl#datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#boolean" + } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/boolean-primitive-type/scalar/default-scalar/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/boolean-primitive-type/scalar/default-scalar/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/boolean-primitive-type/scalar/default-scalar" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "boolean" + } + ] + } + ] + } + ] + } + ], + "http://www.w3.org/ns/shacl#name": [ + { + "@value": "boolean-primitive-type" + } + ], + "http://a.ml/vocabularies/core#description": [ + { + "@value": "this is a documentation for the boolean primitive type" + } + ], + "http://www.w3.org/ns/shacl#defaultValue": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/boolean-primitive-type/scalar_1", + "@type": [ + "http://a.ml/vocabularies/data#Scalar", + "http://a.ml/vocabularies/data#Node", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://a.ml/vocabularies/data#value": [ + { + "@value": "false" + } + ], + "http://www.w3.org/ns/shacl#datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#boolean" + } + ], + "http://a.ml/vocabularies/core#name": [ + { + "@value": "scalar_1" + } + ] + } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/boolean-primitive-type/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/boolean-primitive-type/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/boolean-primitive-type" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "boolean" + } + ] + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/boolean-primitive-type/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "boolean" + } + ] + } + ] + } + ] + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/int-primitive-type", + "@type": [ + "http://www.w3.org/ns/shacl#PropertyShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://a.ml/vocabularies/shapes#range": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/int-primitive-type/scalar/default-scalar", + "@type": [ + "http://a.ml/vocabularies/shapes#ScalarShape", + "http://a.ml/vocabularies/shapes#AnyShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://www.w3.org/ns/shacl#datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#int" + } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/int-primitive-type/scalar/default-scalar/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/int-primitive-type/scalar/default-scalar/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/int-primitive-type/scalar/default-scalar" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "int" + } + ] + } + ] + } + ] + } + ], + "http://www.w3.org/ns/shacl#name": [ + { + "@value": "int-primitive-type" + } + ], + "http://a.ml/vocabularies/core#description": [ + { + "@value": "this is a documentation for the int primitive type" + } + ], + "http://www.w3.org/ns/shacl#defaultValue": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/int-primitive-type/scalar_1", + "@type": [ + "http://a.ml/vocabularies/data#Scalar", + "http://a.ml/vocabularies/data#Node", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://a.ml/vocabularies/data#value": [ + { + "@value": "123" + } + ], + "http://www.w3.org/ns/shacl#datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#integer" + } + ], + "http://a.ml/vocabularies/core#name": [ + { + "@value": "scalar_1" + } + ] + } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/int-primitive-type/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/int-primitive-type/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/int-primitive-type" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "int" + } + ] + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/int-primitive-type/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "int" + } + ] + } + ] + } + ] + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/long-primitive-type", + "@type": [ + "http://www.w3.org/ns/shacl#PropertyShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://a.ml/vocabularies/shapes#range": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/long-primitive-type/scalar/default-scalar", + "@type": [ + "http://a.ml/vocabularies/shapes#ScalarShape", + "http://a.ml/vocabularies/shapes#AnyShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://www.w3.org/ns/shacl#datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#long" + } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/long-primitive-type/scalar/default-scalar/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/long-primitive-type/scalar/default-scalar/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/long-primitive-type/scalar/default-scalar" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "long" + } + ] + } + ] + } + ] + } + ], + "http://www.w3.org/ns/shacl#name": [ + { + "@value": "long-primitive-type" + } + ], + "http://a.ml/vocabularies/core#description": [ + { + "@value": "this is a documentation for the long primitive type" + } + ], + "http://www.w3.org/ns/shacl#defaultValue": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/long-primitive-type/scalar_1", + "@type": [ + "http://a.ml/vocabularies/data#Scalar", + "http://a.ml/vocabularies/data#Node", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://a.ml/vocabularies/data#value": [ + { + "@value": "123" + } + ], + "http://www.w3.org/ns/shacl#datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#integer" + } + ], + "http://a.ml/vocabularies/core#name": [ + { + "@value": "scalar_1" + } + ] + } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/long-primitive-type/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/long-primitive-type/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/long-primitive-type" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "long" + } + ] + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/long-primitive-type/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "long" + } + ] + } + ] + } + ] + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/float-primitive-type", + "@type": [ + "http://www.w3.org/ns/shacl#PropertyShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://a.ml/vocabularies/shapes#range": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/float-primitive-type/scalar/default-scalar", + "@type": [ + "http://a.ml/vocabularies/shapes#ScalarShape", + "http://a.ml/vocabularies/shapes#AnyShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://www.w3.org/ns/shacl#datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#float" + } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/float-primitive-type/scalar/default-scalar/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/float-primitive-type/scalar/default-scalar/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/float-primitive-type/scalar/default-scalar" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "float" + } + ] + } + ] + } + ] + } + ], + "http://www.w3.org/ns/shacl#name": [ + { + "@value": "float-primitive-type" + } + ], + "http://a.ml/vocabularies/core#description": [ + { + "@value": "this is a documentation for the float primitive type" + } + ], + "http://www.w3.org/ns/shacl#defaultValue": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/float-primitive-type/scalar_1", + "@type": [ + "http://a.ml/vocabularies/data#Scalar", + "http://a.ml/vocabularies/data#Node", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://a.ml/vocabularies/data#value": [ + { + "@value": "1.0" + } + ], + "http://www.w3.org/ns/shacl#datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#double" + } + ], + "http://a.ml/vocabularies/core#name": [ + { + "@value": "scalar_1" + } + ] + } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/float-primitive-type/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/float-primitive-type/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/float-primitive-type" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "float" + } + ] + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/float-primitive-type/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "float" + } + ] + } + ] + } + ] + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/double-primitive-type", + "@type": [ + "http://www.w3.org/ns/shacl#PropertyShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://a.ml/vocabularies/shapes#range": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/double-primitive-type/scalar/default-scalar", + "@type": [ + "http://a.ml/vocabularies/shapes#ScalarShape", + "http://a.ml/vocabularies/shapes#AnyShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://www.w3.org/ns/shacl#datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#double" + } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/double-primitive-type/scalar/default-scalar/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/double-primitive-type/scalar/default-scalar/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/double-primitive-type/scalar/default-scalar" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "double" + } + ] + } + ] + } + ] + } + ], + "http://www.w3.org/ns/shacl#name": [ + { + "@value": "double-primitive-type" + } + ], + "http://a.ml/vocabularies/core#description": [ + { + "@value": "this is a documentation for the double primitive type" + } + ], + "http://www.w3.org/ns/shacl#defaultValue": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/double-primitive-type/scalar_1", + "@type": [ + "http://a.ml/vocabularies/data#Scalar", + "http://a.ml/vocabularies/data#Node", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://a.ml/vocabularies/data#value": [ + { + "@value": "1.0" + } + ], + "http://www.w3.org/ns/shacl#datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#double" + } + ], + "http://a.ml/vocabularies/core#name": [ + { + "@value": "scalar_1" + } + ] + } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/double-primitive-type/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/double-primitive-type/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/double-primitive-type" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "double" + } + ] + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/double-primitive-type/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "double" + } + ] + } + ] + } + ] + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/bytes-primitive-type", + "@type": [ + "http://www.w3.org/ns/shacl#PropertyShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://a.ml/vocabularies/shapes#range": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/bytes-primitive-type/scalar/default-scalar", + "@type": [ + "http://a.ml/vocabularies/shapes#ScalarShape", + "http://a.ml/vocabularies/shapes#AnyShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://www.w3.org/ns/shacl#datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#bytes" + } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/bytes-primitive-type/scalar/default-scalar/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/bytes-primitive-type/scalar/default-scalar/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/bytes-primitive-type/scalar/default-scalar" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "bytes" + } + ] + } + ] + } + ] + } + ], + "http://www.w3.org/ns/shacl#name": [ + { + "@value": "bytes-primitive-type" + } + ], + "http://a.ml/vocabularies/core#description": [ + { + "@value": "this is a documentation for the bytes primitive type" + } + ], + "http://www.w3.org/ns/shacl#defaultValue": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/bytes-primitive-type/scalar_1", + "@type": [ + "http://a.ml/vocabularies/data#Scalar", + "http://a.ml/vocabularies/data#Node", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://a.ml/vocabularies/data#value": [ + { + "@value": "\u00FF" + } + ], + "http://www.w3.org/ns/shacl#datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#string" + } + ], + "http://a.ml/vocabularies/core#name": [ + { + "@value": "scalar_1" + } + ] + } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/bytes-primitive-type/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/bytes-primitive-type/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/bytes-primitive-type" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "bytes" + } + ] + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/bytes-primitive-type/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "bytes" + } + ] + } + ] + } + ] + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/string-primitive-type", + "@type": [ + "http://www.w3.org/ns/shacl#PropertyShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://a.ml/vocabularies/shapes#range": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/string-primitive-type/scalar/default-scalar", + "@type": [ + "http://a.ml/vocabularies/shapes#ScalarShape", + "http://a.ml/vocabularies/shapes#AnyShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://www.w3.org/ns/shacl#datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#string" + } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/string-primitive-type/scalar/default-scalar/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/string-primitive-type/scalar/default-scalar/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/string-primitive-type/scalar/default-scalar" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "string" + } + ] + } + ] + } + ] + } + ], + "http://www.w3.org/ns/shacl#name": [ + { + "@value": "string-primitive-type" + } + ], + "http://a.ml/vocabularies/core#description": [ + { + "@value": "this is a documentation for the string primitive type" + } + ], + "http://www.w3.org/ns/shacl#defaultValue": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/string-primitive-type/scalar_1", + "@type": [ + "http://a.ml/vocabularies/data#Scalar", + "http://a.ml/vocabularies/data#Node", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://a.ml/vocabularies/data#value": [ + { + "@value": "foo" + } + ], + "http://www.w3.org/ns/shacl#datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#string" + } + ], + "http://a.ml/vocabularies/core#name": [ + { + "@value": "scalar_1" + } + ] + } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/string-primitive-type/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/string-primitive-type/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/string-primitive-type" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "string" + } + ] + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/string-primitive-type/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "string" + } + ] + } + ] + } + ] + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/union", + "@type": [ + "http://www.w3.org/ns/shacl#PropertyShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://a.ml/vocabularies/shapes#range": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/union/union/union", + "@type": [ + "http://a.ml/vocabularies/shapes#UnionShape", + "http://a.ml/vocabularies/shapes#AnyShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://a.ml/vocabularies/shapes#anyOf": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/union/union/union/anyOf/nil/null", + "@type": [ + "http://a.ml/vocabularies/shapes#NilShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://www.w3.org/ns/shacl#name": [ + { + "@value": "null" + } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/union/union/union/anyOf/nil/null/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/union/union/union/anyOf/nil/null/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/union/union/union/anyOf/nil/null" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "null" + } + ] + } + ] + } + ] + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/union/union/union/anyOf/scalar/default-scalar", + "@type": [ + "http://a.ml/vocabularies/shapes#ScalarShape", + "http://a.ml/vocabularies/shapes#AnyShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/union/union/union/anyOf/scalar/default-scalar/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/union/union/union/anyOf/scalar/default-scalar/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/union/union/union/anyOf/scalar/default-scalar" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "LongList" + } + ] + } + ] + } + ] + } + ], + "http://www.w3.org/ns/shacl#name": [ + { + "@value": "union" + } + ], + "http://a.ml/vocabularies/core#description": [ + { + "@value": "this is a documentation for the union type with recursive element" + } + ], + "http://www.w3.org/ns/shacl#defaultValue": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/union/union/union/scalar_1", + "@type": [ + "http://a.ml/vocabularies/data#Scalar", + "http://a.ml/vocabularies/data#Node", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://a.ml/vocabularies/data#value": [ + { + "@value": "null" + } + ], + "http://www.w3.org/ns/shacl#datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#nil" + } + ], + "http://a.ml/vocabularies/core#name": [ + { + "@value": "scalar_1" + } + ] + } + ], + "http://a.ml/vocabularies/shapes#namespace": [ + { + "@value": "unions" + } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/union/union/union/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/union/union/union/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/union/union/union" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "union" + } + ] + } + ] + } + ] + } + ], + "http://www.w3.org/ns/shacl#name": [ + { + "@value": "union" + } + ], + "http://a.ml/vocabularies/core#description": [ + { + "@value": "this is a documentation for the union type with recursive element" + } + ], + "http://www.w3.org/ns/shacl#defaultValue": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/union/scalar_1", + "@type": [ + "http://a.ml/vocabularies/data#Scalar", + "http://a.ml/vocabularies/data#Node", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://a.ml/vocabularies/data#value": [ + { + "@value": "null" + } + ], + "http://www.w3.org/ns/shacl#datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#nil" + } + ], + "http://a.ml/vocabularies/core#name": [ + { + "@value": "scalar_1" + } + ] + } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/union/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/union/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/union" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "union" + } + ] + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/union/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "union" + } + ] + } + ] + } + ] + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property", + "@type": [ + "http://www.w3.org/ns/shacl#PropertyShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://a.ml/vocabularies/shapes#range": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property/array/default-array", + "@type": [ + "http://a.ml/vocabularies/shapes#ArrayShape", + "http://a.ml/vocabularies/shapes#AnyShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://a.ml/vocabularies/shapes#items": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property/array/default-array/scalar/default-scalar", + "@type": [ + "http://a.ml/vocabularies/shapes#ScalarShape", + "http://a.ml/vocabularies/shapes#AnyShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://www.w3.org/ns/shacl#datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#long" + } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property/array/default-array/scalar/default-scalar/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property/array/default-array/scalar/default-scalar/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property/array/default-array/scalar/default-scalar" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "long" + } + ] + } + ] + } + ] + } + ], + "http://www.w3.org/ns/shacl#defaultValue": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property/array/default-array/array_1", + "@type": [ + "http://a.ml/vocabularies/data#Array", + "http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq", + "http://a.ml/vocabularies/data#Node", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://www.w3.org/2000/01/rdf-schema#member": [], + "http://a.ml/vocabularies/core#name": [ + { + "@value": "array_1" + } + ] + } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property/array/default-array/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property/array/default-array/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property/array/default-array" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "array" + } + ] + } + ] + } + ] + } + ], + "http://www.w3.org/ns/shacl#defaultValue": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property/array_1", + "@type": [ + "http://a.ml/vocabularies/data#Array", + "http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq", + "http://a.ml/vocabularies/data#Node", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://www.w3.org/2000/01/rdf-schema#member": [], + "http://a.ml/vocabularies/core#name": [ + { + "@value": "array_1" + } + ] + } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "array" + } + ] + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "array" + } + ] + } + ] + } + ] + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property_1", + "@type": [ + "http://www.w3.org/ns/shacl#PropertyShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://a.ml/vocabularies/shapes#range": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property_1/array/default-array", + "@type": [ + "http://a.ml/vocabularies/shapes#ArrayShape", + "http://a.ml/vocabularies/shapes#AnyShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://a.ml/vocabularies/shapes#items": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property_1/array/default-array/array/default-array", + "@type": [ + "http://a.ml/vocabularies/shapes#ArrayShape", + "http://a.ml/vocabularies/shapes#AnyShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://a.ml/vocabularies/shapes#items": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property_1/array/default-array/array/default-array/scalar/default-scalar", + "@type": [ + "http://a.ml/vocabularies/shapes#ScalarShape", + "http://a.ml/vocabularies/shapes#AnyShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://www.w3.org/ns/shacl#datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#string" + } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property_1/array/default-array/array/default-array/scalar/default-scalar/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property_1/array/default-array/array/default-array/scalar/default-scalar/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property_1/array/default-array/array/default-array/scalar/default-scalar" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "string" + } + ] + } + ] + } + ] + } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property_1/array/default-array/array/default-array/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property_1/array/default-array/array/default-array/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property_1/array/default-array/array/default-array" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "array" + } + ] + } + ] + } + ] + } + ], + "http://www.w3.org/ns/shacl#defaultValue": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property_1/array/default-array/array_1", + "@type": [ + "http://a.ml/vocabularies/data#Array", + "http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq", + "http://a.ml/vocabularies/data#Node", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://www.w3.org/2000/01/rdf-schema#member": [], + "http://a.ml/vocabularies/core#name": [ + { + "@value": "array_1" + } + ] + } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property_1/array/default-array/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property_1/array/default-array/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property_1/array/default-array" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "array" + } + ] + } + ] + } + ] + } + ], + "http://www.w3.org/ns/shacl#defaultValue": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property_1/array_1", + "@type": [ + "http://a.ml/vocabularies/data#Array", + "http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq", + "http://a.ml/vocabularies/data#Node", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://www.w3.org/2000/01/rdf-schema#member": [], + "http://a.ml/vocabularies/core#name": [ + { + "@value": "array_1" + } + ] + } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property_1/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property_1/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property_1" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "array" + } + ] + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property_1/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "array" + } + ] + } + ] + } + ] + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/Suit", + "@type": [ + "http://www.w3.org/ns/shacl#PropertyShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://a.ml/vocabularies/shapes#range": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/Suit/scalar/Suit", + "@type": [ + "http://a.ml/vocabularies/shapes#ScalarShape", + "http://a.ml/vocabularies/shapes#AnyShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://www.w3.org/ns/shacl#datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#string" + } + ], + "http://www.w3.org/ns/shacl#name": [ + { + "@value": "Suit" + } + ], + "http://www.w3.org/ns/shacl#defaultValue": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/Suit/scalar/Suit/scalar_1", + "@type": [ + "http://a.ml/vocabularies/data#Scalar", + "http://a.ml/vocabularies/data#Node", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://a.ml/vocabularies/data#value": [ + { + "@value": "SPADES" + } + ], + "http://www.w3.org/ns/shacl#datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#string" + } + ], + "http://a.ml/vocabularies/core#name": [ + { + "@value": "scalar_1" + } + ] + } + ], + "http://www.w3.org/ns/shacl#in": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/Suit/scalar/Suit/list", + "@type": "http://www.w3.org/2000/01/rdf-schema#Seq", + "http://www.w3.org/2000/01/rdf-schema#_1": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/Suit/scalar/Suit/in/data-node", + "@type": [ + "http://a.ml/vocabularies/data#Scalar", + "http://a.ml/vocabularies/data#Node", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://a.ml/vocabularies/data#value": [ + { + "@value": "SPADES" + } + ], + "http://www.w3.org/ns/shacl#datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#string" + } + ] + } + ], + "http://www.w3.org/2000/01/rdf-schema#_2": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/Suit/scalar/Suit/in/data-node_3", + "@type": [ + "http://a.ml/vocabularies/data#Scalar", + "http://a.ml/vocabularies/data#Node", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://a.ml/vocabularies/data#value": [ + { + "@value": "HEARTS" + } + ], + "http://www.w3.org/ns/shacl#datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#string" + } + ] + } + ], + "http://www.w3.org/2000/01/rdf-schema#_3": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/Suit/scalar/Suit/in/data-node_4", + "@type": [ + "http://a.ml/vocabularies/data#Scalar", + "http://a.ml/vocabularies/data#Node", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://a.ml/vocabularies/data#value": [ + { + "@value": "DIAMONDS" + } + ], + "http://www.w3.org/ns/shacl#datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#string" + } + ] + } + ], + "http://www.w3.org/2000/01/rdf-schema#_4": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/Suit/scalar/Suit/in/data-node_5", + "@type": [ + "http://a.ml/vocabularies/data#Scalar", + "http://a.ml/vocabularies/data#Node", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://a.ml/vocabularies/data#value": [ + { + "@value": "CLUBS" + } + ], + "http://www.w3.org/ns/shacl#datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#string" + } + ] + } + ] + } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/Suit/scalar/Suit/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/Suit/scalar/Suit/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/Suit/scalar/Suit" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "enum" + } + ] + } + ] + } + ] + } + ], + "http://www.w3.org/ns/shacl#name": [ + { + "@value": "Suit" + } + ], + "http://www.w3.org/ns/shacl#defaultValue": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/Suit/scalar_1", + "@type": [ + "http://a.ml/vocabularies/data#Scalar", + "http://a.ml/vocabularies/data#Node", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://a.ml/vocabularies/data#value": [ + { + "@value": "SPADES" + } + ], + "http://www.w3.org/ns/shacl#datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#string" + } + ], + "http://a.ml/vocabularies/core#name": [ + { + "@value": "scalar_1" + } + ] + } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/Suit/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/Suit/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/Suit" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "enum" + } + ] + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/Suit/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "enum" + } + ] + } + ] + } + ] + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/md5", + "@type": [ + "http://www.w3.org/ns/shacl#PropertyShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://a.ml/vocabularies/shapes#range": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/md5/scalar/md5", + "@type": [ + "http://a.ml/vocabularies/shapes#ScalarShape", + "http://a.ml/vocabularies/shapes#AnyShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://www.w3.org/ns/shacl#datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#fixed" + } + ], + "http://www.w3.org/ns/shacl#name": [ + { + "@value": "md5" + } + ], + "http://a.ml/vocabularies/shapes#size": [ + { + "@value": 16 + } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/md5/scalar/md5/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/md5/scalar/md5/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/md5/scalar/md5" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "fixed" + } + ] + } + ] + } + ] + } + ], + "http://www.w3.org/ns/shacl#name": [ + { + "@value": "md5" + } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/md5/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/md5/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/md5" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "fixed" + } + ] + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/md5/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "fixed" + } + ] + } + ] + } + ] + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property_2", + "@type": [ + "http://www.w3.org/ns/shacl#PropertyShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://a.ml/vocabularies/shapes#range": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property_2/shape/default-node", + "@type": [ + "http://www.w3.org/ns/shacl#NodeShape", + "http://a.ml/vocabularies/shapes#AnyShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://www.w3.org/ns/shacl#additionalPropertiesSchema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property_2/shape/default-node/scalar/default-scalar", + "@type": [ + "http://a.ml/vocabularies/shapes#ScalarShape", + "http://a.ml/vocabularies/shapes#AnyShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://www.w3.org/ns/shacl#datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#long" + } + ] + } + ], + "http://www.w3.org/ns/shacl#defaultValue": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property_2/shape/default-node/object_1", + "@type": [ + "http://a.ml/vocabularies/data#Object", + "http://a.ml/vocabularies/data#Node", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://a.ml/vocabularies/core#name": [ + { + "@value": "object_1" + } + ] + } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property_2/shape/default-node/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property_2/shape/default-node/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property_2/shape/default-node" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "map" + } + ] + } + ] + } + ] + } + ], + "http://www.w3.org/ns/shacl#defaultValue": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property_2/object_1", + "@type": [ + "http://a.ml/vocabularies/data#Object", + "http://a.ml/vocabularies/data#Node", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://a.ml/vocabularies/core#name": [ + { + "@value": "object_1" + } + ] + } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property_2/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property_2/source-map/avro-schema/element_1", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property_2" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "map" + } + ] + }, + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property_2/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "http://a.ml/vocabularies/shapes#range" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "map" + } + ] + } + ] + } + ] + } + ], + "http://www.w3.org/ns/shacl#name": [ + { + "@value": "AllTypes" + } + ], + "http://a.ml/vocabularies/core#description": [ + { + "@value": "this schema contains every possible type you can declare in avro inside it's fields" + } + ], + "http://a.ml/vocabularies/shapes#namespace": [ + { + "@value": "root" + } + ], + "http://a.ml/vocabularies/shapes#aliases": [ + { + "@value": "EveryTypeInTheSameSchema" + } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "record" + } + ] + } + ] + } + ] + } + ], + "http://a.ml/vocabularies/document#root": [ + { + "@value": true + } + ], + "http://a.ml/vocabularies/document#package": [ + { + "@value": "root" + } + ], + "http://a.ml/vocabularies/document#processingData": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/BaseUnitProcessingData", + "@type": [ + "http://a.ml/vocabularies/document#BaseUnitProcessingData" + ], + "http://a.ml/vocabularies/document#sourceSpec": [ + { + "@value": "Avro" + } + ] + } + ] + } +] From be9c7554ec287f20d11b7067df0dca65c968dbe8 Mon Sep 17 00:00:00 2001 From: arielmirra Date: Tue, 16 Jul 2024 11:31:18 -0300 Subject: [PATCH 4/4] W-16006973: add avro schema ann. to collection members --- .../domain/AvroCollectionShapeParser.scala | 13 ++- .../cycle/avro/valid/all-types.jsonld | 23 +++++ .../upanddown/cycle/avro/valid/map.jsonld | 23 +++++ .../cycle/avro/valid/nested-schema.jsonld | 90 ++++++++++++++++++- 4 files changed, 146 insertions(+), 3 deletions(-) diff --git a/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/spec/avro/parser/domain/AvroCollectionShapeParser.scala b/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/spec/avro/parser/domain/AvroCollectionShapeParser.scala index 1b088f19e4..74e6288723 100644 --- a/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/spec/avro/parser/domain/AvroCollectionShapeParser.scala +++ b/amf-api-contract/shared/src/main/scala/amf/apicontract/internal/spec/avro/parser/domain/AvroCollectionShapeParser.scala @@ -4,6 +4,8 @@ import amf.apicontract.internal.spec.avro.parser.context.AvroSchemaContext import amf.core.internal.parser.YMapOps import amf.shapes.client.scala.model.domain.AnyShape import org.yaml.model.{YMap, YMapEntry} +import amf.shapes.internal.annotations.AVROSchemaType +import org.yaml.model.YScalar abstract class AvroCollectionShapeParser[T <: AnyShape](map: YMap, membersKey: String)(implicit ctx: AvroSchemaContext) extends AvroComplexShapeParser(map) { @@ -20,5 +22,14 @@ abstract class AvroCollectionShapeParser[T <: AnyShape](map: YMap, membersKey: S shape } - protected def parseMembers(e: YMapEntry): AnyShape = AvroTextTypeParser(e.value.as[String], None).parse() + protected def parseMembers(e: YMapEntry): AnyShape = { + e.value.value match { + case scalar: YScalar => + val avroType = scalar.text + val parsedShape = AvroTextTypeParser(avroType, None).parse() + parsedShape.annotations += AVROSchemaType(avroType) + parsedShape + case map: YMap => new AvroShapeParser(map).parse().getOrElse(AnyShape()) + } + } } diff --git a/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.jsonld b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.jsonld index 8f60fa8089..502ced1c5a 100644 --- a/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.jsonld +++ b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.jsonld @@ -1792,6 +1792,29 @@ { "@id": "http://www.w3.org/2001/XMLSchema#long" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property_2/shape/default-node/scalar/default-scalar/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property_2/shape/default-node/scalar/default-scalar/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/all-types.json#/shape/AllTypes/property/property/default-property_2/shape/default-node/scalar/default-scalar" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "long" + } + ] + } + ] + } ] } ], diff --git a/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/map.jsonld b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/map.jsonld index fc8df36aa7..b09e2c2bcf 100644 --- a/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/map.jsonld +++ b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/map.jsonld @@ -32,6 +32,29 @@ { "@id": "http://www.w3.org/2001/XMLSchema#long" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/map.json#/shape/default-node/scalar/default-scalar/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/map.json#/shape/default-node/scalar/default-scalar/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/map.json#/shape/default-node/scalar/default-scalar" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "long" + } + ] + } + ] + } ] } ], diff --git a/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.jsonld b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.jsonld index 29fb551656..47a46651ae 100644 --- a/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.jsonld +++ b/amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.jsonld @@ -193,6 +193,29 @@ { "@id": "http://www.w3.org/2001/XMLSchema#long" } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.json#/shape/TestRecordWithMapsAndArrays/property/property/map/shape/default-node/scalar/default-scalar/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.json#/shape/TestRecordWithMapsAndArrays/property/property/map/shape/default-node/scalar/default-scalar/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.json#/shape/TestRecordWithMapsAndArrays/property/property/map/shape/default-node/scalar/default-scalar" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "long" + } + ] + } + ] + } ] } ], @@ -458,13 +481,76 @@ ], "http://www.w3.org/ns/shacl#additionalPropertiesSchema": [ { - "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.json#/shape/TestRecordWithMapsAndArrays/property/property/nested_map/shape/default-node/scalar/default-scalar", + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.json#/shape/TestRecordWithMapsAndArrays/property/property/nested_map/shape/default-node/shape/default-node", "@type": [ - "http://a.ml/vocabularies/shapes#ScalarShape", + "http://www.w3.org/ns/shacl#NodeShape", "http://a.ml/vocabularies/shapes#AnyShape", "http://www.w3.org/ns/shacl#Shape", "http://a.ml/vocabularies/shapes#Shape", "http://a.ml/vocabularies/document#DomainElement" + ], + "http://www.w3.org/ns/shacl#additionalPropertiesSchema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.json#/shape/TestRecordWithMapsAndArrays/property/property/nested_map/shape/default-node/shape/default-node/scalar/default-scalar", + "@type": [ + "http://a.ml/vocabularies/shapes#ScalarShape", + "http://a.ml/vocabularies/shapes#AnyShape", + "http://www.w3.org/ns/shacl#Shape", + "http://a.ml/vocabularies/shapes#Shape", + "http://a.ml/vocabularies/document#DomainElement" + ], + "http://www.w3.org/ns/shacl#datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#long" + } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.json#/shape/TestRecordWithMapsAndArrays/property/property/nested_map/shape/default-node/shape/default-node/scalar/default-scalar/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.json#/shape/TestRecordWithMapsAndArrays/property/property/nested_map/shape/default-node/shape/default-node/scalar/default-scalar/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.json#/shape/TestRecordWithMapsAndArrays/property/property/nested_map/shape/default-node/shape/default-node/scalar/default-scalar" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "long" + } + ] + } + ] + } + ] + } + ], + "http://a.ml/vocabularies/document-source-maps#sources": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.json#/shape/TestRecordWithMapsAndArrays/property/property/nested_map/shape/default-node/shape/default-node/source-map", + "@type": [ + "http://a.ml/vocabularies/document-source-maps#SourceMap" + ], + "http://a.ml/vocabularies/document-source-maps#avro-schema": [ + { + "@id": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.json#/shape/TestRecordWithMapsAndArrays/property/property/nested_map/shape/default-node/shape/default-node/source-map/avro-schema/element_0", + "http://a.ml/vocabularies/document-source-maps#element": [ + { + "@value": "file://amf-cli/shared/src/test/resources/upanddown/cycle/avro/valid/nested-schema.json#/shape/TestRecordWithMapsAndArrays/property/property/nested_map/shape/default-node/shape/default-node" + } + ], + "http://a.ml/vocabularies/document-source-maps#value": [ + { + "@value": "map" + } + ] + } + ] + } ] } ],