-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathfeatures.yaml
More file actions
72 lines (68 loc) · 1.81 KB
/
features.yaml
File metadata and controls
72 lines (68 loc) · 1.81 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
63
64
65
66
67
68
69
70
71
72
# https://swagger.io/specification/
openapi: 3.1.0
info:
title: Constant String Example (Full with Unions)
version: 1.0.0
paths:
/status:
get:
summary: Get a fixed status (enum-style constant)
responses:
"200":
description: Always returns status = "active"
content:
application/json:
schema:
type: object
properties:
status:
type: string
enum: ["active"] # constant string via enum
/version:
get:
summary: Get API version (const-style constant)
responses:
"200":
description: Always returns version = "v1"
content:
application/json:
schema:
type: object
properties:
version:
type: string
const: "v1" # constant string via const
/events:
get:
summary: Get an event (discriminated union with const)
responses:
"200":
description: Returns an event object
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/UserCreated"
- $ref: "#/components/schemas/UserDeleted"
discriminator:
propertyName: type
components:
schemas:
UserCreated:
type: object
properties:
type:
type: string
const: "user_created" # discriminator value
userId:
type: string
required: [type, userId]
UserDeleted:
type: object
properties:
type:
type: string
const: "user_deleted" # discriminator value
userId:
type: string
required: [type, userId]