-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1109 from aml-org/publish-4.7.7
Publish 4.7.7
- Loading branch information
Showing
116 changed files
with
1,332 additions
and
615 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.