-
Notifications
You must be signed in to change notification settings - Fork 9
/
featureJson.js
43 lines (39 loc) · 1.01 KB
/
featureJson.js
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
const { z } = require('zod');
const FeatureJsonLinkSchema = z.object({
name: z.string(),
href: z.string().url(),
});
/**
* The shape of data in feature.json files.
*/
const FeatureJsonSchema = z.object({
category: z.string(),
identifier: z.string(),
name: z.string(),
description: z.string(),
explainer: z.string().optional(),
/**
* URL reference to a section of the Open Booking API
*/
specificationReference: z.string().url(),
/**
* Is it required for an implementation to implement this feature?
*/
required: z.boolean(),
/**
* How much test coverage has been written for this feature
*/
coverageStatus: z.enum(['none', 'partial', 'complete']),
/**
* Description of when this feature is required
*/
requiredCondition: z.string().optional(),
links: z.array(FeatureJsonLinkSchema).optional(),
requiresOneOfIfImplemented: z.array(z.string()).optional(),
});
/**
* @typedef {z.infer<typeof FeatureJsonSchema>} FeatureJson
*/
module.exports = {
FeatureJsonSchema,
};