Skip to content

Commit

Permalink
Merge pull request #1109 from aml-org/publish-4.7.7
Browse files Browse the repository at this point in the history
Publish 4.7.7
  • Loading branch information
arielmirra committed Aug 26, 2021
2 parents ef46177 + dd89b55 commit bf92095
Show file tree
Hide file tree
Showing 116 changed files with 1,332 additions and 615 deletions.
7 changes: 5 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ def headerFlavour = "WARNING"

pipeline {
agent {
dockerfile true
dockerfile {
filename 'Dockerfile'
registryCredentialsId 'dockerhub-pro-credentials'
}
}
environment {
NEXUS = credentials('exchange-nexus')
Expand Down Expand Up @@ -158,7 +161,7 @@ pipeline {
}
def newAmfVersion = getAmfVersion()
echo "Starting ApiQuery hook API-Query/api-query-amf-integration/master with amf version: ${newAmfVersion}"
build job: "API-Query/api-query-amf-integration/master", wait: false, parameters: [[$class: 'StringParameterValue', name: 'AMF_NEW_VERSION', value: newAmfVersion]]
build job: "API-Query-new/api-query-amf-integration/master", wait: false, parameters: [[$class: 'StringParameterValue', name: 'AMF_NEW_VERSION', value: newAmfVersion]]
}
} catch(ignored) {
failedStage = failedStage + " JOBS TRIGGER "
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ The **only** guaranteed output of AMF is the JSON-LD "AMF model". Any other outp

## Documentation
- [The AML Project](https://a.ml)
- [What is AMF?](https://a.ml/docbook/overview_amf.html)
- [What is AMF?](https://a.ml/docs)
- [AMF model documentation](documentation/model.md)
- [Validation insights](./documentation/validation.md)
- [Basic use cases - parsing & validating an API](documentation/basic_use_cases.md)
Expand Down
27 changes: 27 additions & 0 deletions adrs/0010-shape-annotation-types.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 10. Annotation types
Date: 2021-08-20

## Status
Accepted

## Context
When AMF builds a model from a content, it must justify from where each node and property came from, so the users can track and know for sure the origin of the values. This source map information is fundamental for editing features.

In a parsed API, the elements declared in the source document have their corresponding annotations (think of `LexicalInformation` or `SourceNode`) in the final model, but some elements in the AMF model are not explicitly declared. Moreover, some of this not-declared elements are fields we can easily infer from the source document (like the name of an operation) while others have no real counterpart in the source document.

## Decision
For these reasons, the decision has been made in favor of adding 3 annotation types to make every object or field traceable to where it came from, whether it was from the source document or it was generated by AMF:

- `Annotations.inferred()`
- A field is **inferred** when the entry has been inferred but the value is real (is present in the source document)
- Example: The name of an operation, which has no entry `name` but we can infer it from it's declaration in the document
- `Annotations.virtual()`
- An object is **virtual** when it's generated without having a counterpart in the source document
- Example: The `Request` object in the AMF model
- `Annotations.synthesized()`
- A field is **synthesized** when the entry as well as the value are inferred
- This field has nothing that matches it on the AST, and the same is true for its children
- Examples: `PropertyShape.MinCount` when it's set to 1 based on a `required: true`

## Consequences
This decision has no immediate impact.
Original file line number Diff line number Diff line change
Expand Up @@ -4833,6 +4833,77 @@
]
}
]
},
{
"@id": "file://amf-client/shared/src/test/resources/production/oas-complex-example/spec/NewPet.json#/and/1/item1/property/name",
"@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://www.w3.org/ns/shacl#path": [
{
"@id": "http://a.ml/vocabularies/data#name"
}
],
"http://a.ml/vocabularies/shapes#range": [
{
"@id": "file://amf-client/shared/src/test/resources/production/oas-complex-example/spec/NewPet.json#/and/1/item1/property/name/any/default-any",
"@type": [
"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#minCount": [
{
"@value": 1
}
],
"http://www.w3.org/ns/shacl#name": [
{
"@value": "name"
}
],
"http://a.ml/vocabularies/document-source-maps#sources": [
{
"@id": "file://amf-client/shared/src/test/resources/production/oas-complex-example/spec/NewPet.json#/and/1/item1/property/name/source-map",
"@type": [
"http://a.ml/vocabularies/document-source-maps#SourceMap"
],
"http://a.ml/vocabularies/document-source-maps#synthesized-field": [
{
"@id": "file://amf-client/shared/src/test/resources/production/oas-complex-example/spec/NewPet.json#/and/1/item1/property/name/source-map/synthesized-field/element_1",
"http://a.ml/vocabularies/document-source-maps#element": [
{
"@value": "http://www.w3.org/ns/shacl#path"
}
],
"http://a.ml/vocabularies/document-source-maps#value": [
{
"@value": "true"
}
]
},
{
"@id": "file://amf-client/shared/src/test/resources/production/oas-complex-example/spec/NewPet.json#/and/1/item1/property/name/source-map/synthesized-field/element_0",
"http://a.ml/vocabularies/document-source-maps#element": [
{
"@value": "http://www.w3.org/ns/shacl#minCount"
}
],
"http://a.ml/vocabularies/document-source-maps#value": [
{
"@value": "true"
}
]
}
]
}
]
}
],
"http://www.w3.org/ns/shacl#name": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2091,6 +2091,9 @@
"http://www.w3.org/ns/shacl#property": [
{
"@id": "file://amf-client/shared/src/test/resources/production/oas-complex-example/spec/NewPet.json#/and/1/item1/property/description"
},
{
"@id": "file://amf-client/shared/src/test/resources/production/oas-complex-example/spec/NewPet.json#/and/1/item1/property/name"
}
],
"http://www.w3.org/ns/shacl#name": "item1",
Expand Down Expand Up @@ -2655,6 +2658,30 @@
}
]
},
{
"@id": "file://amf-client/shared/src/test/resources/production/oas-complex-example/spec/NewPet.json#/and/1/item1/property/name",
"@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://www.w3.org/ns/shacl#path": [
{
"@id": "http://a.ml/vocabularies/data#name"
}
],
"http://a.ml/vocabularies/shapes#range": {
"@id": "file://amf-client/shared/src/test/resources/production/oas-complex-example/spec/NewPet.json#/and/1/item1/property/name/any/default-any"
},
"http://www.w3.org/ns/shacl#minCount": 1,
"http://www.w3.org/ns/shacl#name": "name",
"http://a.ml/vocabularies/document-source-maps#sources": [
{
"@id": "file://amf-client/shared/src/test/resources/production/oas-complex-example/spec/NewPet.json#/and/1/item1/property/name/source-map"
}
]
},
{
"@id": "file://amf-client/shared/src/test/resources/production/oas-complex-example/spec/NewPet.json#/and/1/item1/source-map",
"@type": [
Expand Down Expand Up @@ -3116,6 +3143,29 @@
}
]
},
{
"@id": "file://amf-client/shared/src/test/resources/production/oas-complex-example/spec/NewPet.json#/and/1/item1/property/name/any/default-any",
"@type": [
"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"
]
},
{
"@id": "file://amf-client/shared/src/test/resources/production/oas-complex-example/spec/NewPet.json#/and/1/item1/property/name/source-map",
"@type": [
"http://a.ml/vocabularies/document-source-maps#SourceMap"
],
"http://a.ml/vocabularies/document-source-maps#synthesized-field": [
{
"@id": "file://amf-client/shared/src/test/resources/production/oas-complex-example/spec/NewPet.json#/and/1/item1/property/name/source-map/synthesized-field/element_1"
},
{
"@id": "file://amf-client/shared/src/test/resources/production/oas-complex-example/spec/NewPet.json#/and/1/item1/property/name/source-map/synthesized-field/element_0"
}
]
},
{
"@id": "file://amf-client/shared/src/test/resources/production/oas-complex-example/spec/NewPet.json#/and/1/item1/source-map/synthesized-field/element_0",
"http://a.ml/vocabularies/document-source-maps#element": "http://www.w3.org/ns/shacl#closed",
Expand Down Expand Up @@ -3373,6 +3423,16 @@
"http://a.ml/vocabularies/document-source-maps#element": "file://amf-client/shared/src/test/resources/production/oas-complex-example/spec/NewPet.json#/and/1/item1/property/description",
"http://a.ml/vocabularies/document-source-maps#value": "[(12,8)-(15,9)]"
},
{
"@id": "file://amf-client/shared/src/test/resources/production/oas-complex-example/spec/NewPet.json#/and/1/item1/property/name/source-map/synthesized-field/element_1",
"http://a.ml/vocabularies/document-source-maps#element": "http://www.w3.org/ns/shacl#path",
"http://a.ml/vocabularies/document-source-maps#value": "true"
},
{
"@id": "file://amf-client/shared/src/test/resources/production/oas-complex-example/spec/NewPet.json#/and/1/item1/property/name/source-map/synthesized-field/element_0",
"http://a.ml/vocabularies/document-source-maps#element": "http://www.w3.org/ns/shacl#minCount",
"http://a.ml/vocabularies/document-source-maps#value": "true"
},
{
"@id": "file://amf-client/shared/src/test/resources/production/oas-complex-example/spec/Pet.json#/schema/property/id/scalar/id/source-map/type-property-lexical-info/element_0",
"http://a.ml/vocabularies/document-source-maps#element": "file://amf-client/shared/src/test/resources/production/oas-complex-example/spec/Pet.json#/schema/property/id/scalar/id",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@
],
"http://a.ml/vocabularies/document-source-maps#value": [
{
"@value": "[(7,20)-(11,7)]"
"@value": "[(7,6)-(11,7)]"
}
]
},
Expand Down Expand Up @@ -926,7 +926,7 @@
],
"http://a.ml/vocabularies/document-source-maps#value": [
{
"@value": "[(5,16)-(15,3)]"
"@value": "[(5,2)-(15,3)]"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@
{
"@id": "file://amf-client/shared/src/test/resources/production/raml08/definitions-loops-crossfiles/api.raml#/declarations/schemas/someSchema/source-map/lexical/element_2",
"http://a.ml/vocabularies/document-source-maps#element": "http://www.w3.org/ns/shacl#property",
"http://a.ml/vocabularies/document-source-maps#value": "[(5,16)-(15,3)]"
"http://a.ml/vocabularies/document-source-maps#value": "[(5,2)-(15,3)]"
},
{
"@id": "file://amf-client/shared/src/test/resources/production/raml08/definitions-loops-crossfiles/api.raml#/declarations/schemas/someSchema/source-map/lexical/element_0",
Expand Down Expand Up @@ -646,7 +646,7 @@
{
"@id": "file://amf-client/shared/src/test/resources/production/raml08/definitions-loops-crossfiles/api.raml#/declarations/schemas/someSchema/property/a1/B/source-map/lexical/element_2",
"http://a.ml/vocabularies/document-source-maps#element": "http://www.w3.org/ns/shacl#property",
"http://a.ml/vocabularies/document-source-maps#value": "[(7,20)-(11,7)]"
"http://a.ml/vocabularies/document-source-maps#value": "[(7,6)-(11,7)]"
},
{
"@id": "file://amf-client/shared/src/test/resources/production/raml08/definitions-loops-crossfiles/api.raml#/declarations/schemas/someSchema/property/a1/B/source-map/lexical/element_0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@
],
"http://a.ml/vocabularies/document-source-maps#value": [
{
"@value": "[(7,20)-(11,7)]"
"@value": "[(7,6)-(11,7)]"
}
]
},
Expand Down Expand Up @@ -1197,7 +1197,7 @@
],
"http://a.ml/vocabularies/document-source-maps#value": [
{
"@value": "[(5,16)-(15,3)]"
"@value": "[(5,2)-(15,3)]"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@
{
"@id": "file://amf-client/shared/src/test/resources/production/raml08/definitions-loops-crossfiles2/api.raml#/declarations/schemas/someSchema/source-map/lexical/element_2",
"http://a.ml/vocabularies/document-source-maps#element": "http://www.w3.org/ns/shacl#property",
"http://a.ml/vocabularies/document-source-maps#value": "[(5,16)-(15,3)]"
"http://a.ml/vocabularies/document-source-maps#value": "[(5,2)-(15,3)]"
},
{
"@id": "file://amf-client/shared/src/test/resources/production/raml08/definitions-loops-crossfiles2/api.raml#/declarations/schemas/someSchema/source-map/lexical/element_0",
Expand Down Expand Up @@ -867,7 +867,7 @@
{
"@id": "file://amf-client/shared/src/test/resources/production/raml08/definitions-loops-crossfiles2/api.raml#/declarations/schemas/someSchema/property/a1/B/source-map/lexical/element_2",
"http://a.ml/vocabularies/document-source-maps#element": "http://www.w3.org/ns/shacl#property",
"http://a.ml/vocabularies/document-source-maps#value": "[(7,20)-(11,7)]"
"http://a.ml/vocabularies/document-source-maps#value": "[(7,6)-(11,7)]"
},
{
"@id": "file://amf-client/shared/src/test/resources/production/raml08/definitions-loops-crossfiles2/api.raml#/declarations/schemas/someSchema/property/a1/B/source-map/lexical/element_0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@
],
"http://a.ml/vocabularies/document-source-maps#value": [
{
"@value": "[(35,20)-(45,7)]"
"@value": "[(35,6)-(45,7)]"
}
]
},
Expand Down Expand Up @@ -1231,7 +1231,7 @@
],
"http://a.ml/vocabularies/document-source-maps#value": [
{
"@value": "[(20,20)-(30,7)]"
"@value": "[(20,6)-(30,7)]"
}
]
},
Expand Down Expand Up @@ -1590,7 +1590,7 @@
],
"http://a.ml/vocabularies/document-source-maps#value": [
{
"@value": "[(5,16)-(15,3)]"
"@value": "[(5,2)-(15,3)]"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@
{
"@id": "file://amf-client/shared/src/test/resources/production/raml08/definitions-loops/api.raml#/declarations/schemas/someSchema/source-map/lexical/element_3",
"http://a.ml/vocabularies/document-source-maps#element": "http://www.w3.org/ns/shacl#property",
"http://a.ml/vocabularies/document-source-maps#value": "[(5,16)-(15,3)]"
"http://a.ml/vocabularies/document-source-maps#value": "[(5,2)-(15,3)]"
},
{
"@id": "file://amf-client/shared/src/test/resources/production/raml08/definitions-loops/api.raml#/declarations/schemas/someSchema/source-map/lexical/element_1",
Expand Down Expand Up @@ -732,7 +732,7 @@
{
"@id": "file://amf-client/shared/src/test/resources/production/raml08/definitions-loops/api.raml#/declarations/schemas/someSchema/property/auditDetails/auditDetails/source-map/lexical/element_0",
"http://a.ml/vocabularies/document-source-maps#element": "http://www.w3.org/ns/shacl#property",
"http://a.ml/vocabularies/document-source-maps#value": "[(20,20)-(30,7)]"
"http://a.ml/vocabularies/document-source-maps#value": "[(20,6)-(30,7)]"
},
{
"@id": "file://amf-client/shared/src/test/resources/production/raml08/definitions-loops/api.raml#/declarations/schemas/someSchema/property/auditDetails/auditDetails/source-map/lexical/element_1",
Expand Down Expand Up @@ -1083,7 +1083,7 @@
{
"@id": "file://amf-client/shared/src/test/resources/production/raml08/definitions-loops/api.raml#/declarations/schemas/someSchema/property/auditDetails/auditDetails/property/formOfPayment/formOfPayment/source-map/lexical/element_0",
"http://a.ml/vocabularies/document-source-maps#element": "http://www.w3.org/ns/shacl#property",
"http://a.ml/vocabularies/document-source-maps#value": "[(35,20)-(45,7)]"
"http://a.ml/vocabularies/document-source-maps#value": "[(35,6)-(45,7)]"
},
{
"@id": "file://amf-client/shared/src/test/resources/production/raml08/definitions-loops/api.raml#/declarations/schemas/someSchema/property/auditDetails/auditDetails/property/formOfPayment/formOfPayment/source-map/lexical/element_1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@
],
"http://a.ml/vocabularies/document-source-maps#value": [
{
"@value": "[(28,20)-(35,7)]"
"@value": "[(28,6)-(35,7)]"
}
]
}
Expand Down Expand Up @@ -939,7 +939,7 @@
],
"http://a.ml/vocabularies/document-source-maps#value": [
{
"@value": "[(14,20)-(24,7)]"
"@value": "[(14,6)-(24,7)]"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@
{
"@id": "file://../jsonschema/schema-lib.json/#/definitions/address/source-map/lexical/element_0",
"http://a.ml/vocabularies/document-source-maps#element": "http://www.w3.org/ns/shacl#property",
"http://a.ml/vocabularies/document-source-maps#value": "[(14,20)-(24,7)]"
"http://a.ml/vocabularies/document-source-maps#value": "[(14,6)-(24,7)]"
},
{
"@id": "file://../jsonschema/schema-lib.json/#/definitions/address/source-map/declared-element/element_0",
Expand Down Expand Up @@ -657,7 +657,7 @@
{
"@id": "file://../jsonschema/schema-lib.json/#/definitions/address/property/location/location/source-map/lexical/element_0",
"http://a.ml/vocabularies/document-source-maps#element": "http://www.w3.org/ns/shacl#property",
"http://a.ml/vocabularies/document-source-maps#value": "[(28,20)-(35,7)]"
"http://a.ml/vocabularies/document-source-maps#value": "[(28,6)-(35,7)]"
},
{
"@id": "file://../jsonschema/schema-lib.json/#/definitions/address/property/location/location/source-map/type-property-lexical-info/element_0",
Expand Down
Loading

0 comments on commit bf92095

Please sign in to comment.