Skip to content

Commit 8bf8edf

Browse files
authored
Merge pull request #133 from pflooky/strict-schema
Add in strict schema to ensure no additional properties not defined i…
2 parents b651dbe + a9eb903 commit 8bf8edf

File tree

3 files changed

+2466
-1
lines changed

3 files changed

+2466
-1
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
version: "1.0.0"
2+
apiVersion: "v3.0.2"
3+
kind: "DataContract"
4+
id: "strict-test-002"
5+
name: "Strict Schema Test Invalid"
6+
status: "active"
7+
# undefinedRootProperty: "this should fail" # Testing root level
8+
servers:
9+
- server: "test-server"
10+
type: "postgresql"
11+
host: "localhost"
12+
port: 5432
13+
database: "testdb"
14+
schema: "public"
15+
description: "Test PostgreSQL server"
16+
undefinedServerProperty: "this should fail" # Testing Server object level
17+
customProperties:
18+
- property: "validCustomProp"
19+
value: "this is fine"
20+
- undefinedCustomProp: "this should fail" # Testing CustomProperties array item level
21+
schema:
22+
- name: "users"
23+
physicalName: "users_table"
24+
logicalType: "object"
25+
physicalType: "table"
26+
description: "User information table"
27+
undefinedSchemaProperty: "this should fail" # Testing Schema object level
28+
properties:
29+
- name: "id"
30+
logicalType: "integer"
31+
physicalType: "INT"
32+
required: true
33+
primaryKey: true
34+
description: "Unique identifier for the user"
35+
undefinedPropertyField: "this should fail" # Testing Property level
36+
logicalTypeOptions:
37+
format: "i32"
38+
undefinedOption: "this should fail" # Testing nested logicalTypeOptions level
39+
minLength: 2 # Testing option from string logicalType
40+
- name: "email"
41+
logicalType: "string"
42+
physicalType: "VARCHAR(255)"
43+
required: true
44+
description: "User's email address"
45+
quality:
46+
- name: "email_check"
47+
type: "library"
48+
dimension: "accuracy"
49+
rule: "validValues"
50+
undefinedQualityProp: "this should fail" # Testing quality check level
51+
query: SELECT * FROM table # Testing option from type sql
52+
roles:
53+
- role: abc123
54+
underfinedRoleProp: fail
55+
authoritativeDefinitions:
56+
- url: http://localhost:8080
57+
type: businessDefinition
58+
underfinedAuthDefProp: fail
59+
support:
60+
- channel: channel1
61+
url: http://localhost:8080
62+
underfinedSupportProp: fail
63+
price:
64+
underfinedPriceProp: fail
65+
team:
66+
- username: user123
67+
underfinedTeamProp: fail
68+
slaProperties:
69+
- property: slaProp
70+
value: 123
71+
underfinedSlaProp: fail

0 commit comments

Comments
 (0)