Skip to content

Commit eaf40ae

Browse files
committed
more complete testing
1 parent fdd9f32 commit eaf40ae

2 files changed

Lines changed: 100 additions & 4 deletions

File tree

index.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,15 @@ module.exports = {
237237
}
238238
})
239239
},
240+
Note: {
241+
type: 'object',
242+
properties: merge(ExtensibleDataProperties, {
243+
lang: { type: 'string' },
244+
subject: { type: 'string' },
245+
text: { type: 'string' },
246+
attribution: { $ref: '/#definitions/Attribution' }
247+
})
248+
},
240249
OnlineAccount: {
241250
type: 'object',
242251
properties: merge(ExtensibleDataProperties, {
@@ -321,7 +330,7 @@ module.exports = {
321330
mediator: { $ref: '#/definitions/ResourceReference' },
322331
sources: {
323332
type: 'array',
324-
items: { $ref: 'SourceReference' }
333+
items: { $ref: '#/definitions/SourceReference' }
325334
},
326335
analysis: { $ref: '#/definitions/ResourceReference' },
327336
componentOf: { $ref: '#/definitions/ResourceReference' },
@@ -343,7 +352,7 @@ module.exports = {
343352
type: 'array',
344353
items: { $ref: '#/definitions/TextValue' }
345354
},
346-
identifiers: { $ref: '#/definitions/Identifiers' },
355+
identifiers: { $ref: '#/definitions/Identifier' },
347356
created: { type: 'integer' },
348357
modified: { type: 'integer' },
349358
repository: { $ref: '#/definitions/ResourceReference' }

test/test.js

Lines changed: 89 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ it('validates', function(){
88
assert.jsonSchema({
99
persons: [
1010
{
11-
id: 'testPerson',
12-
private: true,
11+
private: false,
1312
gender: {
1413
type: 'http://gedcomx.org/Female'
1514
},
@@ -34,6 +33,94 @@ it('validates', function(){
3433
}
3534
}
3635
]
36+
}
37+
],
38+
relationships: [
39+
{
40+
type: 'http://gedcomx.org/Couple',
41+
person1: {
42+
resource: 'http://identifier/for/person/1'
43+
},
44+
person2: {
45+
resource: 'http://identifier/for/person/2'
46+
},
47+
facts: [
48+
{
49+
type: 'http://gedcomx.org/Marriage'
50+
}
51+
]
52+
}
53+
],
54+
sourceDescriptions: [
55+
{
56+
resourceType: 'http://some/type',
57+
citations: [
58+
{
59+
lang: 'en',
60+
value: 'Long source citation'
61+
}
62+
],
63+
mediaType: 'book',
64+
about: 'http://a/resource',
65+
mediator: {
66+
resource: 'http://mediator'
67+
},
68+
sources: [
69+
{
70+
description: 'http://source/reference'
71+
}
72+
],
73+
analysis: {
74+
resource: 'http://analysis'
75+
},
76+
componentOf: {
77+
description: 'http://container'
78+
},
79+
titles: [
80+
{
81+
lang: 'en',
82+
value: 'Title'
83+
},
84+
{
85+
lang: 'es',
86+
value: 'Titulo'
87+
}
88+
],
89+
notes: [
90+
{
91+
subject: 'Note',
92+
text: 'Some note text'
93+
}
94+
],
95+
attribution: {
96+
created: 1234578129
97+
},
98+
rights: [
99+
{
100+
resource: 'https://some/right'
101+
}
102+
],
103+
coverage: {
104+
temporal: {
105+
formal: '+2015'
106+
},
107+
spatial: {
108+
original: 'A place'
109+
}
110+
},
111+
descriptions: [
112+
{
113+
value: 'A description'
114+
}
115+
],
116+
identifiers: {
117+
$: 'identifier'
118+
},
119+
created: 1000000,
120+
modified: 11111111,
121+
repository: {
122+
resource: 'http://repository'
123+
}
37124
}
38125
]
39126
}, gedxSchema);

0 commit comments

Comments
 (0)