Skip to content

Commit

Permalink
IBX-8778: Introduce API Platform attributes with schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
tischsoic committed Aug 27, 2024
1 parent d860b11 commit 6842847
Show file tree
Hide file tree
Showing 14 changed files with 2,305 additions and 0 deletions.
80 changes: 80 additions & 0 deletions src/bundle/Resources/api_platform/bookmarks_schemas.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
schemas:
BookmarkList:
description: List of bookmarked Locations.
type: object
required:
- count
- items
properties:
count:
description: The total number of bookmarks.
type: integer
items:
description: List of bookmarked Locations.
type: array
items:
type: object
required:
- Location
- _media-type
- __href
properties:
Location:
type:
$ref: "#/components/schemas/Location"
_media-type:
type: string
__href:
type: string
BookmarkListWrapper:
type: object
required:
- BookmarkList
properties:
BookmarkList:
type:
$ref: "#/components/schemas/BookmarkList"
SummaryEntry:
type: object
required:
- identifier
- id
- names
- quantity
- Price
- PriceInclVat
- SubtotalPrice
- SubtotalPriceInclVat
- VatCategory
- Product
properties:
identifier:
type: string
id:
type: integer
names:
type:
$ref: "#/components/schemas/SummaryEntryNames"
quantity:
type: integer
Price:
type:
$ref: "#/components/schemas/RestPriceWrapper"
PriceInclVat:
type:
$ref: "#/components/schemas/RestPriceWrapper"
SubtotalPrice:
type:
$ref: "#/components/schemas/RestPriceWrapper"
SubtotalPriceInclVat:
type:
$ref: "#/components/schemas/RestPriceWrapper"
VatCategory:
type:
$ref: "#/components/schemas/VatCategory"
Product:
type:
$ref: "#/components/schemas/Product"
SummaryEntryNames:
type:
$ref: "#/components/schemas/ValueObject"
189 changes: 189 additions & 0 deletions src/bundle/Resources/api_platform/content_locations_schemas.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
schemas:
Location:
allOf:
- $ref: "#/components/schemas/BaseObject"
- description: This class represents a Location in the Repository.
type: object
required:
- id
- priority
- hidden
- invisible
- remoteId
- ContentInfo
- ParentLocation
- pathString
- depth
- childCount
- sortField
- sortOrder
- Content
properties:
id:
description: The ID of the Location.
type: integer
priority:
description: Location priority. Position of the Location among its siblings when sorted using priority sort order.
type: integer
hidden:
description: Indicates that the Location entity has been explicitly marked as hidden.
type: boolean
invisible:
description: Indicates that the Location is implicitly marked as hidden by a parent Location.
type: boolean
remoteId:
description: Remote ID, universally unique identifier.
type: string
ContentInfo:
description: This class provides all version independent information of the content item.
type:
$ref: "#/components/schemas/ContentInfo"
ParentLocation:
description: Parent Location.
Children:
description: Children Location.
pathString:
description: The materialized path of the Location entry e.g. /1/2/.
type: string
depth:
description: Depth Location has in the Location tree.
type: integer
childCount:
description: Depth Location has in the Location tree.
type: integer
sortField:
description: "Specifies which property the child Locations should be sorted on. Map for Location sort fields to their respective SortClauses - class name/identifier and modified subnode. One of the fallowing values: PATH."
enum:
- PATH
- PUBLISHED
- MODIFIED
- SECTION
- DEPTH
- CLASS_IDENTIFIER
- CLASS_NAME
- PRIORITY
- NAME
- MODIFIED_SUBNODE
- NODE_ID
- CONTENTOBJECT_ID
type: string
sortOrder:
description: "Specifies whether the sort order should be ascending or descending. Map for Location sort order to their respective Query SORT constants. One of the fallowing values: const SORT_ORDER_DESC = 0; const SORT_ORDER_ASC = 1."
enum:
- ASC
- DESC
type: string
Content:
description: Represents a content item in a specific version.
UrlAliases:
description: This class represents URL aliases.
LocationWrapper:
type: object
required:
- Location
properties:
Location:
$ref: "#/components/schemas/Location"
LocationCreate:
allOf:
- $ref: "#/components/schemas/BaseObject"
- type: object
required:
- ParentLocation
- priority
- hidden
- sortField
- sortOrder
properties:
ParentLocation:
type: object
required:
- _href
properties:
_href:
xml:
attribute: true
name: href
type: string
priority:
type: string
hidden:
type: [string, boolean]
sortField:
type: string
sortOrder:
type: string
LocationCreateWrapper:
type: object
required:
- LocationCreate
properties:
LocationCreate:
$ref: "#/components/schemas/LocationCreate"
LocationUpdateStruct:
description: This class is used for updating Location meta data.
type: object
required:
- priority
- remoteId
- hidden
- sortField
- sortOrder
properties:
priority:
description: If set the Location priority is changed to the new value.
type: string
remoteId:
description: If set the Location gets a new remoteId. Needs to be a unique Location->remoteId string value.
type: string
hidden:
type: boolean
sortField:
description: If set the sortField is changed. The sort field specifies which property the child Locations should be sorted on. Valid values are found at {@link Location::SORT_FIELD_*}.
enum:
- PATH
- PUBLISHED
- MODIFIED
- SECTION
- DEPTH
- CLASS_IDENTIFIER
- CLASS_NAME
- PRIORITY
- NAME
- MODIFIED_SUBNODE
- NODE_ID
- CONTENTOBJECT_ID
type: string
sortOrder:
description: If set the sortOrder is changed. The sort order specifies whether the sort order should be ascending or descending. Valid values are {@link Location::SORT_ORDER_*}.
enum:
- ASC
- DESC
type: string
LocationUpdateStructWrapper:
type: object
required:
- LocationUpdate
properties:
LocationUpdate:
$ref: "#/components/schemas/LocationUpdateStruct"
LocationList:
allOf:
- $ref: "#/components/schemas/BaseObject"
- description: This class represents a queried Location list holding a totalCount and a partial list of Locations (by offset/limit parameters and permission filters).
type: object
required:
- Location
properties:
Location:
description: The partial list of Locations controlled by offset/limit.
type: array
items:
$ref: "#/components/schemas/Ref"
LocationListWrapper:
type: object
required:
- LocationList
properties:
LocationList:
$ref: "#/components/schemas/LocationList"
Loading

0 comments on commit 6842847

Please sign in to comment.