Repository navigation
Expand file tree
/
Copy pathopenapi-ts.config.ts
More file actions
62 lines (54 loc) · 1.7 KB
/
Copy pathopenapi-ts.config.ts
File metadata and controls
62 lines (54 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// SPDX-FileCopyrightText: Copyright 2025 New Vector Ltd.
// SPDX-FileCopyrightText: Copyright 2025, 2026 Element Creations Ltd.
//
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
import { defineConfig } from "@hey-api/openapi-ts";
export default defineConfig({
input:
"http://element-hq.github.io/matrix-authentication-service/api/spec.json",
output: {
path: "src/api/mas/api",
postProcess: ["oxlint", "oxfmt"],
},
parser: {
pagination: {
keywords: ["page[first]", "page[last]", "page[before]", "page[after]"],
},
patch: {
schemas: {
User: (schema) => {
// Make the 'legacy_guest' flag on users optional, as it was
// introduced in MAS 1.3.0
schema.required = schema.required
? schema.required.filter((property) => property !== "legacy_guest")
: undefined;
},
UpstreamOAuthProvider: (schema) => {
// Make the 'registration_token_required' flag on upstream providers
// optional, as it was introduced in MAS 1.19.0
schema.required = schema.required
? schema.required.filter(
(property) => property !== "registration_token_required",
)
: undefined;
},
SiteConfig: (schema) => {
// Only make the `server_name` required, rest can be optional
schema.required = ["server_name"];
},
},
},
},
plugins: [
{
name: "@hey-api/client-fetch",
},
{
name: "@hey-api/sdk",
// Use valibot for response validations
validator: "valibot",
// Force passing the client as parameter
client: false,
},
],
});