forked from aep-dev/aep-components
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathx-aep-resource.yaml
More file actions
58 lines (58 loc) · 1.83 KB
/
Copy pathx-aep-resource.yaml
File metadata and controls
58 lines (58 loc) · 1.83 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
$schema: https://json-schema.org/draft/2020-12/schema
$id: https://aep.dev/json-schema/extensions/x-aep-resource.json
title: x-aep-resource
description: Defines the resource name patterns and naming for an AEP API resource
type: object
required:
- plural
- parents
- patterns
- singular
- type
properties:
plural:
type: string
description: The plural form of the resource name
pattern: "^[a-z][a-z0-9-]*$"
parents:
type: array
description: The parent resources of this resource.
items:
type: string
# see https://aep.dev/4/#type-name
pattern: "^[a-z0-9][a-z0-9.-]*/[a-z0-9][-a-z0-9]*$"
examples:
- "library.example.com/author"
- "library.example.com/user-profile"
patterns:
type: array
description: The resource name patterns that are valid for this resource
items:
type: string
# see https://aep.dev/4/#annotating-resource-types
# this asserts for a leading collection name and pairs of collection, id segments.
pattern: "^[a-z][a-z0-9-]*(/\\{[a-z][a-z0-9_]*\\}|[a-z][a-z0-9-])*" # WIP
examples:
- "books/{book_id}"
- "authors/{author_id}/books/{book_id}"
- "authors/{author_id}/books/{book_id}"
minItems: 1
singleton:
type: boolean
description: If true, the resource is a singleton.
default: false
singular:
type: string
description: The singular form of the resource name
pattern: "^[a-z][a-z0-9-]*$"
type:
type: string
description: >
The type of resource, in the form of `{api name}.{resource singular}`.
For example, `api.examples.com/user`.
# see https://aep.dev/4/#type-name
pattern: "^[a-z0-9][a-z0-9_.]*/[a-z0-9][-a-z0-9]*$"
examples:
- "library.example.com/book"
- "library.example.com/author"
- "library.example.com/user-profile"