Skip to content

Commit d095fb0

Browse files
committed
User Story 37144: Driver User Agent
- Created a JSON Schema that defines the user agent JSON payload format.
1 parent 1eabf80 commit d095fb0

File tree

2 files changed

+118
-1
lines changed

2 files changed

+118
-1
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ insert_final_newline = true
1111
indent_style = space
1212
indent_size = 4
1313

14-
[project.json]
14+
[*.{json,jsonc}]
1515
indent_size = 2
1616

1717
# C# files

spec/user-agent.jsonc

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
{
2+
// This is the JSON Schema that defines the format of the driver user agent
3+
// payload sent to the server during login.
4+
//
5+
// The design document is here:
6+
//
7+
// https://microsoft.sharepoint-df.com/:w:/t/sqldevx/ERIWTt0zlCxLroNHyaPlKYwBI_LNSff6iy_wXZ8xX6nctQ?e=9Cr35Q
8+
9+
"$schema": "https://json-schema.org/draft/2020-12/schema",
10+
"$id": "urn:microsoft:mssql:user-agent:v1",
11+
"title": "Driver User Agent",
12+
"description": "The user agent payload sent by the driver to the server during login.",
13+
14+
"type": "object",
15+
"properties":
16+
{
17+
"driver":
18+
{
19+
"enum": ["MS-JDBC", "MS-MDS", "MS-ODBC", "MS-OLEDB", "MS-PHP", "MS-PYTHON"],
20+
"description": "The type of driver."
21+
},
22+
"version":
23+
{
24+
"type": "string",
25+
"description": "The version of the driver, as a semantic version.",
26+
// See:
27+
//
28+
// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
29+
//
30+
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$"
31+
},
32+
"os":
33+
{
34+
"type": "object",
35+
"description": "Information about the operating system.",
36+
"properties":
37+
{
38+
"type":
39+
{
40+
"enum": ["Windows", "Linux", "macOS", "FreeBSD", "Android", "Unknown"],
41+
"description": "The type of operating system."
42+
},
43+
"details":
44+
{
45+
"type": "string",
46+
"description": "Extended details of the operating system."
47+
}
48+
}
49+
},
50+
"arch":
51+
{
52+
"type": "string",
53+
"description": "The architecture of the driver process."
54+
},
55+
"runtime":
56+
{
57+
"type": "string",
58+
"description": "The runtime environment of the driver."
59+
},
60+
"ext":
61+
{
62+
"type": "object",
63+
"description": "Extended properties for the user agent.",
64+
"properties":
65+
{
66+
"agentId":
67+
{
68+
"type": "string",
69+
"description": "A unique identifier for the agent using the driver."
70+
},
71+
"agentVersion":
72+
{
73+
"type": "string",
74+
"description": "The version of the agent using the driver."
75+
}
76+
},
77+
"additionalProperties": false
78+
}
79+
},
80+
"additionalProperties": false,
81+
"required": [
82+
"driver",
83+
"version",
84+
"os",
85+
"arch",
86+
"runtime"
87+
],
88+
"examples": [
89+
{
90+
"driver": "MS-MDS",
91+
"version": "6.0.2",
92+
"os":
93+
{
94+
"type": "Linux",
95+
"details": "Debian GNU Linux 12.2 Bookworm"
96+
},
97+
"arch": "amd64",
98+
"runtime": ".NET 9.0.3"
99+
},
100+
{
101+
"driver": "MS-JDBC",
102+
"version": "11.2.0",
103+
"os":
104+
{
105+
"type": "Windows",
106+
"details": "Windows 10 Pro 22H2"
107+
},
108+
"arch": "x64",
109+
"runtime": "Java 17.0.8+7-LTS",
110+
"ext":
111+
{
112+
"agentId": "12345678-1234-5678-1234-567812345678",
113+
"agentVersion": "1.0.0"
114+
}
115+
}
116+
]
117+
}

0 commit comments

Comments
 (0)