Skip to content

Commit be9ecb0

Browse files
committed
feat(oas, x-aep-resource): add type, parents to schema
- Adding the type annotation, to match protobuf and clarify the type name. - Adding parents to enable the enumeration of the parents of the resource (which will simplify client and tool parsing).
1 parent 9858031 commit be9ecb0

1 file changed

Lines changed: 19 additions & 5 deletions

File tree

json_schema/extensions/x-aep-resource.yaml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,24 @@ title: x-aep-resource
44
description: Defines the resource name patterns and naming for an AEP API resource
55
type: object
66
required:
7-
- singular
87
- plural
8+
- parents
99
- patterns
10+
- singular
11+
- type
1012
properties:
11-
singular:
12-
type: string
13-
description: The singular form of the resource name
14-
pattern: "^[a-z][a-z0-9-]*$"
1513
plural:
1614
type: string
1715
description: The plural form of the resource name
1816
pattern: "^[a-z][a-z0-9-]*$"
17+
parents:
18+
type: array
19+
description: The parent resources of this resource
20+
items:
21+
type: string
22+
pattern: "^[a-z0-9][.-a-z0-9/]*[a-z0-9]$"
23+
examples:
24+
- "library.example.com/author"
1925
patterns:
2026
type: array
2127
description: The resource name patterns that are valid for this resource
@@ -27,8 +33,16 @@ properties:
2733
type: boolean
2834
description: If true, the resource is a singleton.
2935
default: false
36+
singular:
37+
type: string
38+
description: The singular form of the resource name
39+
pattern: "^[a-z][a-z0-9-]*$"
3040
type:
3141
type: string
3242
description: >
3343
The type of resource, in the form of `{api name}.{resource singular}`.
3444
For example, `api.examples.com/user`.
45+
pattern: "^[a-z0-9][.-a-z0-9/]*[a-z0-9]$"
46+
examples:
47+
- "library.example.com/book"
48+
- "library.example.com/author"

0 commit comments

Comments
 (0)