-
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.
added extends together with embed test
- Loading branch information
Showing
8 changed files
with
326 additions
and
6 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
1 change: 1 addition & 0 deletions
1
crates/weaver_resolver/data/registry-test-11-prefix-refs-extends/README.md
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 @@ | ||
Test adding a prefix to the references in attributes together with extends keyword. |
83 changes: 83 additions & 0 deletions
83
...weaver_resolver/data/registry-test-11-prefix-refs-extends/expected-attribute-catalog.json
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,83 @@ | ||
[ | ||
{ | ||
"name": "client.id", | ||
"type": "string", | ||
"brief": "some client id\n", | ||
"examples": [ | ||
"a.einstein" | ||
], | ||
"requirement_level": "recommended", | ||
"stability": "experimental" | ||
}, | ||
{ | ||
"name": "geo.lat", | ||
"type": "string", | ||
"brief": "latitude of the geo coordinates.\n", | ||
"examples": [ | ||
"123.456" | ||
], | ||
"requirement_level": "recommended", | ||
"stability": "experimental" | ||
}, | ||
{ | ||
"name": "geo.lon", | ||
"type": "string", | ||
"brief": "longitude of the geo coordinates.\n", | ||
"examples": [ | ||
"234.456" | ||
], | ||
"requirement_level": "recommended", | ||
"stability": "experimental" | ||
}, | ||
{ | ||
"name": "geo.country", | ||
"type": "string", | ||
"brief": "country of the geo coordinates.\n", | ||
"examples": [ | ||
"US" | ||
], | ||
"requirement_level": "recommended", | ||
"stability": "experimental" | ||
}, | ||
{ | ||
"name": "geo.lat", | ||
"type": "string", | ||
"brief": "this is ref attribute", | ||
"examples": [ | ||
"123.456" | ||
], | ||
"requirement_level": "recommended", | ||
"stability": "experimental" | ||
}, | ||
{ | ||
"name": "geo.country", | ||
"type": "string", | ||
"brief": "this is ref country attribute", | ||
"examples": [ | ||
"US" | ||
], | ||
"requirement_level": "recommended", | ||
"stability": "experimental" | ||
}, | ||
{ | ||
"name": "client.geo.lat", | ||
"type": "string", | ||
"brief": "My own latitude", | ||
"examples": [ | ||
"123.456" | ||
], | ||
"requirement_level": "recommended", | ||
"stability": "experimental", | ||
"prefix": true | ||
}, | ||
{ | ||
"name": "client.geo.lat", | ||
"type": "string", | ||
"brief": "this is embedded attribute", | ||
"examples": [ | ||
"123.456" | ||
], | ||
"requirement_level": "recommended", | ||
"stability": "experimental" | ||
} | ||
] |
181 changes: 181 additions & 0 deletions
181
crates/weaver_resolver/data/registry-test-11-prefix-refs-extends/expected-registry.json
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,181 @@ | ||
{ | ||
"registry_url": "https://127.0.0.1", | ||
"groups": [ | ||
{ | ||
"id": "registry.client", | ||
"type": "attribute_group", | ||
"brief": "Describes information about the client.", | ||
"prefix": "client", | ||
"attributes": [ | ||
0, | ||
6 | ||
], | ||
"lineage": { | ||
"source_file": "data/registry-test-11-prefix-refs-extends/registry/client.yaml", | ||
"attributes": { | ||
"client.geo.lat": { | ||
"source_group": "registry.geo", | ||
"inherited_fields": [ | ||
"examples", | ||
"note", | ||
"requirement_level", | ||
"stability" | ||
], | ||
"locally_overridden_fields": [ | ||
"brief" | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"id": "registry.geo", | ||
"type": "attribute_group", | ||
"brief": "Attributes describing geo.", | ||
"prefix": "geo", | ||
"attributes": [ | ||
1, | ||
2, | ||
3 | ||
], | ||
"lineage": { | ||
"source_file": "data/registry-test-11-prefix-refs-extends/registry/geo.yaml" | ||
} | ||
}, | ||
{ | ||
"id": "usage", | ||
"type": "attribute_group", | ||
"brief": "Attributes for test.", | ||
"prefix": "usage", | ||
"attributes": [ | ||
0, | ||
2, | ||
4, | ||
7 | ||
], | ||
"lineage": { | ||
"source_file": "data/registry-test-11-prefix-refs-extends/registry/usage.yaml", | ||
"attributes": { | ||
"client.geo.lat": { | ||
"source_group": "registry.client", | ||
"inherited_fields": [ | ||
"examples", | ||
"note", | ||
"requirement_level", | ||
"stability" | ||
], | ||
"locally_overridden_fields": [ | ||
"brief" | ||
] | ||
}, | ||
"client.id": { | ||
"source_group": "registry.client", | ||
"inherited_fields": [ | ||
"brief", | ||
"examples", | ||
"note", | ||
"requirement_level", | ||
"stability" | ||
] | ||
}, | ||
"geo.lat": { | ||
"source_group": "registry.geo", | ||
"inherited_fields": [ | ||
"examples", | ||
"note", | ||
"requirement_level", | ||
"stability" | ||
], | ||
"locally_overridden_fields": [ | ||
"brief" | ||
] | ||
}, | ||
"geo.lon": { | ||
"source_group": "registry.geo", | ||
"inherited_fields": [ | ||
"brief", | ||
"examples", | ||
"note", | ||
"requirement_level", | ||
"stability" | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"id": "usage2", | ||
"type": "attribute_group", | ||
"brief": "Attributes for test.", | ||
"prefix": "usage2", | ||
"attributes": [ | ||
0, | ||
2, | ||
4, | ||
5, | ||
7 | ||
], | ||
"lineage": { | ||
"source_file": "data/registry-test-11-prefix-refs-extends/registry/usage2.yaml", | ||
"attributes": { | ||
"client.geo.lat": { | ||
"source_group": "registry.client", | ||
"inherited_fields": [ | ||
"examples", | ||
"note", | ||
"requirement_level", | ||
"stability" | ||
], | ||
"locally_overridden_fields": [ | ||
"brief" | ||
] | ||
}, | ||
"client.id": { | ||
"source_group": "registry.client", | ||
"inherited_fields": [ | ||
"brief", | ||
"examples", | ||
"note", | ||
"requirement_level", | ||
"stability" | ||
] | ||
}, | ||
"geo.country": { | ||
"source_group": "registry.geo", | ||
"inherited_fields": [ | ||
"examples", | ||
"note", | ||
"requirement_level", | ||
"stability" | ||
], | ||
"locally_overridden_fields": [ | ||
"brief" | ||
] | ||
}, | ||
"geo.lat": { | ||
"source_group": "registry.geo", | ||
"inherited_fields": [ | ||
"examples", | ||
"note", | ||
"requirement_level", | ||
"stability" | ||
], | ||
"locally_overridden_fields": [ | ||
"brief" | ||
] | ||
}, | ||
"geo.lon": { | ||
"source_group": "registry.geo", | ||
"inherited_fields": [ | ||
"brief", | ||
"examples", | ||
"note", | ||
"requirement_level", | ||
"stability" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} |
15 changes: 15 additions & 0 deletions
15
crates/weaver_resolver/data/registry-test-11-prefix-refs-extends/registry/client.yaml
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,15 @@ | ||
groups: | ||
- id: registry.client | ||
prefix: client | ||
type: attribute_group | ||
brief: "Describes information about the client." | ||
attributes: | ||
- id: id | ||
type: string | ||
stability: experimental | ||
brief: > | ||
some client id | ||
examples: ['a.einstein'] | ||
- ref: geo.lat | ||
prefix: true | ||
brief: My own latitude |
24 changes: 24 additions & 0 deletions
24
crates/weaver_resolver/data/registry-test-11-prefix-refs-extends/registry/geo.yaml
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,24 @@ | ||
groups: | ||
- id: registry.geo | ||
brief: Attributes describing geo. | ||
type: attribute_group | ||
prefix: geo | ||
attributes: | ||
- id: lat | ||
type: string | ||
stability: experimental | ||
brief: > | ||
latitude of the geo coordinates. | ||
examples: ["123.456"] | ||
- id: lon | ||
type: string | ||
stability: experimental | ||
brief: > | ||
longitude of the geo coordinates. | ||
examples: [ "234.456" ] | ||
- id: country | ||
type: string | ||
stability: experimental | ||
brief: > | ||
country of the geo coordinates. | ||
examples: [ "US" ] |
12 changes: 12 additions & 0 deletions
12
crates/weaver_resolver/data/registry-test-11-prefix-refs-extends/registry/usage.yaml
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,12 @@ | ||
groups: | ||
- id: usage | ||
brief: Attributes for test. | ||
type: attribute_group | ||
prefix: usage | ||
attributes: | ||
- ref: geo.lat | ||
brief: this is ref attribute | ||
- ref: client.id | ||
- ref: geo.lon | ||
- ref: client.geo.lat | ||
brief: this is embedded attribute |
9 changes: 9 additions & 0 deletions
9
crates/weaver_resolver/data/registry-test-11-prefix-refs-extends/registry/usage2.yaml
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,9 @@ | ||
groups: | ||
- id: usage2 | ||
brief: Attributes for test. | ||
type: attribute_group | ||
prefix: usage2 | ||
extends: usage | ||
attributes: | ||
- ref: geo.country | ||
brief: this is ref country attribute |