Skip to content

Commit dab22d3

Browse files
committed
adjust schemas and annotations
1 parent 40cff86 commit dab22d3

File tree

5 files changed

+219
-99
lines changed

5 files changed

+219
-99
lines changed

src/bundle/Resources/api_platform/base.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
schemas:
2+
BaseObject:
3+
type: object
4+
required:
5+
- _media-type
6+
properties:
7+
_media-type:
8+
xml:
9+
attribute: true
10+
name: media-type
11+
type: string
12+
_href:
13+
xml:
14+
attribute: true
15+
name: href
16+
type: string
17+
Ref:
18+
type:
19+
$ref: "#/components/schemas/BaseObject"
20+
UnixTimestamp:
21+
type: integer
22+
Href:
23+
type: object
24+
required:
25+
- _href
26+
properties:
27+
_href:
28+
xml:
29+
attribute: true
30+
name: href
31+
type: string
32+
Target:
33+
description: Struct that stores extra target information for a SortClause object.
34+
type: object
35+
SortClause:
36+
description: This class is the base for SortClause classes, used to set sorting of content queries.
37+
type: object
38+
required:
39+
- direction
40+
- target
41+
- targetData
42+
properties:
43+
direction:
44+
description: Sort direction. One of Query::SORT_ASC or Query::SORT_DESC.
45+
type: string
46+
target:
47+
description: "Sort target, high level: section_identifier, attribute_value, etc."
48+
type: string
49+
targetData:
50+
description: Extra target data, required by some sort clauses, field for instance.
51+
type:
52+
$ref: "#/components/schemas/Target"
53+
ErrorMessage:
54+
description: Represents an error response. Might contain additional properties depending on an error type.
55+
type: object
56+
required:
57+
- errorCode
58+
- errorMessage
59+
- errorDescription
60+
properties:
61+
errorCode:
62+
type: integer
63+
errorMessage:
64+
type: string
65+
errorDescription:
66+
type: string
67+
Value:
68+
description: Struct that stores extra value information for a Criterion object.
69+
type: object
70+
required:
71+
- _languageCode
72+
- "#text"
73+
properties:
74+
_languageCode:
75+
description: Language code.
76+
type: string
77+
"#text":
78+
description: Content type description.
79+
type: [string, 'null']
80+
ValueObject:
81+
type: object
82+
required:
83+
- value
84+
properties:
85+
value:
86+
type: array
87+
items:
88+
$ref: "#/components/schemas/Value"
89+
ValueArray:
90+
type: object
91+
required:
92+
- value
93+
properties:
94+
value:
95+
type: array
96+
items:
97+
$ref: "#/components/schemas/Value"
98+
MultilingualValue:
99+
allOf:
100+
- $ref: "#/components/schemas/Value"
101+
- description: Object that represents a multilingual (translated) value.
102+
type: object
103+
required:
104+
- _languageCode
105+
- "#text"
106+
properties:
107+
_languageCode:
108+
description: Language code.
109+
type: string
110+
"#text":
111+
description: Translation contents.
112+
type: [string, 'null']
113+
KeyValue:
114+
description: Key-value structure
115+
type: object
116+
required:
117+
- _key
118+
- "#text"
119+
properties:
120+
_key:
121+
type: string
122+
"#text":
123+
type: [string, 'null']
124+
DateRange:
125+
allOf:
126+
- $ref: "#/components/schemas/BaseObject"
127+
- description: Representation of date range.
128+
type: object
129+
required:
130+
- startDate
131+
- endDate
132+
properties:
133+
startDate:
134+
type: string
135+
endDate:
136+
type: string

src/bundle/Resources/api_platform/language_schemas.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
schemas:
22
Language:
33
allOf:
4-
- ref: "#/components/schemas/BaseObject"
4+
- $ref: "#/components/schemas/BaseObject"
55
- description: This class represents a language in the Repository.
66
type: object
77
required:
@@ -11,7 +11,7 @@ schemas:
1111
properties:
1212
languageId:
1313
description: The language ID (auto generated).
14-
type: integer
14+
type: [string, 'null']
1515
languageCode:
1616
description: The languageCode code.
1717
type: string
@@ -27,7 +27,7 @@ schemas:
2727
$ref: "#/components/schemas/Language"
2828
LanguageList:
2929
allOf:
30-
- ref: "#/components/schemas/BaseObject"
30+
- $ref: "#/components/schemas/BaseObject"
3131
- description: List of languages.
3232
type: object
3333
required:

src/bundle/Resources/config/api_platform.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ services:
4040
autoconfigure: true
4141
arguments:
4242
$files:
43-
- '@@IbexaRestBundle/Resources/api_platform/base.yml'
43+
- '@@IbexaRestBundle/Resources/api_platform/base_schemas.yml'
4444
- '@@IbexaRestBundle/Resources/api_platform/language_schemas.yml'

0 commit comments

Comments
 (0)