Skip to content

Commit

Permalink
adjust schemas and annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
tischsoic committed Aug 27, 2024
1 parent 40cff86 commit dab22d3
Show file tree
Hide file tree
Showing 5 changed files with 219 additions and 99 deletions.
14 changes: 0 additions & 14 deletions src/bundle/Resources/api_platform/base.yml

This file was deleted.

136 changes: 136 additions & 0 deletions src/bundle/Resources/api_platform/base_schemas.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
schemas:
BaseObject:
type: object
required:
- _media-type
properties:
_media-type:
xml:
attribute: true
name: media-type
type: string
_href:
xml:
attribute: true
name: href
type: string
Ref:
type:
$ref: "#/components/schemas/BaseObject"
UnixTimestamp:
type: integer
Href:
type: object
required:
- _href
properties:
_href:
xml:
attribute: true
name: href
type: string
Target:
description: Struct that stores extra target information for a SortClause object.
type: object
SortClause:
description: This class is the base for SortClause classes, used to set sorting of content queries.
type: object
required:
- direction
- target
- targetData
properties:
direction:
description: Sort direction. One of Query::SORT_ASC or Query::SORT_DESC.
type: string
target:
description: "Sort target, high level: section_identifier, attribute_value, etc."
type: string
targetData:
description: Extra target data, required by some sort clauses, field for instance.
type:
$ref: "#/components/schemas/Target"
ErrorMessage:
description: Represents an error response. Might contain additional properties depending on an error type.
type: object
required:
- errorCode
- errorMessage
- errorDescription
properties:
errorCode:
type: integer
errorMessage:
type: string
errorDescription:
type: string
Value:
description: Struct that stores extra value information for a Criterion object.
type: object
required:
- _languageCode
- "#text"
properties:
_languageCode:
description: Language code.
type: string
"#text":
description: Content type description.
type: [string, 'null']
ValueObject:
type: object
required:
- value
properties:
value:
type: array
items:
$ref: "#/components/schemas/Value"
ValueArray:
type: object
required:
- value
properties:
value:
type: array
items:
$ref: "#/components/schemas/Value"
MultilingualValue:
allOf:
- $ref: "#/components/schemas/Value"
- description: Object that represents a multilingual (translated) value.
type: object
required:
- _languageCode
- "#text"
properties:
_languageCode:
description: Language code.
type: string
"#text":
description: Translation contents.
type: [string, 'null']
KeyValue:
description: Key-value structure
type: object
required:
- _key
- "#text"
properties:
_key:
type: string
"#text":
type: [string, 'null']
DateRange:
allOf:
- $ref: "#/components/schemas/BaseObject"
- description: Representation of date range.
type: object
required:
- startDate
- endDate
properties:
startDate:
type: string
endDate:
type: string
6 changes: 3 additions & 3 deletions src/bundle/Resources/api_platform/language_schemas.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
schemas:
Language:
allOf:
- ref: "#/components/schemas/BaseObject"
- $ref: "#/components/schemas/BaseObject"
- description: This class represents a language in the Repository.
type: object
required:
Expand All @@ -11,7 +11,7 @@ schemas:
properties:
languageId:
description: The language ID (auto generated).
type: integer
type: [string, 'null']
languageCode:
description: The languageCode code.
type: string
Expand All @@ -27,7 +27,7 @@ schemas:
$ref: "#/components/schemas/Language"
LanguageList:
allOf:
- ref: "#/components/schemas/BaseObject"
- $ref: "#/components/schemas/BaseObject"
- description: List of languages.
type: object
required:
Expand Down
2 changes: 1 addition & 1 deletion src/bundle/Resources/config/api_platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ services:
autoconfigure: true
arguments:
$files:
- '@@IbexaRestBundle/Resources/api_platform/base.yml'
- '@@IbexaRestBundle/Resources/api_platform/base_schemas.yml'
- '@@IbexaRestBundle/Resources/api_platform/language_schemas.yml'
Loading

0 comments on commit dab22d3

Please sign in to comment.