Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBX-9058: Fix OpenApi type/$ref/oneOf usage #159

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/bundle/Resources/api_platform/schemas/base_schemas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ schemas:
name: href
type: string
Ref:
type:
$ref: "#/components/schemas/BaseObject"
$ref: "#/components/schemas/BaseObject"
UnixTimestamp:
type: integer
Href:
Expand Down Expand Up @@ -48,8 +47,7 @@ schemas:
type: string
targetData:
description: Extra target data, required by some sort clauses, field for instance.
type:
$ref: "#/components/schemas/Target"
$ref: "#/components/schemas/Target"
ErrorMessage:
description: Represents an error response. Might contain additional properties depending on an error type.
type: object
Expand Down
30 changes: 10 additions & 20 deletions src/bundle/Resources/api_platform/schemas/bookmarks_schemas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ schemas:
- __href
properties:
Location:
type:
$ref: "#/components/schemas/Location"
$ref: "#/components/schemas/Location"
_media-type:
type: string
__href:
Expand All @@ -32,8 +31,7 @@ schemas:
- BookmarkList
properties:
BookmarkList:
type:
$ref: "#/components/schemas/BookmarkList"
$ref: "#/components/schemas/BookmarkList"
SummaryEntry:
type: object
required:
Expand All @@ -53,28 +51,20 @@ schemas:
id:
type: integer
names:
type:
$ref: "#/components/schemas/SummaryEntryNames"
$ref: "#/components/schemas/SummaryEntryNames"
quantity:
type: integer
Price:
type:
$ref: "#/components/schemas/RestPriceWrapper"
$ref: "#/components/schemas/RestPriceWrapper"
PriceInclVat:
type:
$ref: "#/components/schemas/RestPriceWrapper"
$ref: "#/components/schemas/RestPriceWrapper"
SubtotalPrice:
type:
$ref: "#/components/schemas/RestPriceWrapper"
$ref: "#/components/schemas/RestPriceWrapper"
SubtotalPriceInclVat:
type:
$ref: "#/components/schemas/RestPriceWrapper"
$ref: "#/components/schemas/RestPriceWrapper"
VatCategory:
type:
$ref: "#/components/schemas/VatCategory"
$ref: "#/components/schemas/VatCategory"
Product:
type:
$ref: "#/components/schemas/Product"
$ref: "#/components/schemas/Product"
SummaryEntryNames:
type:
$ref: "#/components/schemas/ValueObject"
$ref: "#/components/schemas/ValueObject"
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ schemas:
type: string
ContentInfo:
description: This class provides all version independent information of the content item.
type:
$ref: "#/components/schemas/ContentInfo"
$ref: "#/components/schemas/ContentInfo"
ParentLocation:
description: Parent Location.
Children:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,31 +34,25 @@ schemas:
type: integer
ContentType:
description: Content type.
type:
$ref: "#/components/schemas/BaseObject"
$ref: "#/components/schemas/BaseObject"
Name:
description: Name of the domain object in a given language.
type: string
Versions:
description: Returns the VersionInfo for this version.
type:
$ref: "#/components/schemas/BaseObject"
$ref: "#/components/schemas/BaseObject"
CurrentVersion:
description: Current version.
type:
$ref: "#/components/schemas/BaseObject"
$ref: "#/components/schemas/BaseObject"
Section:
description: The Section to which the content item is assigned to.
type:
$ref: "#/components/schemas/BaseObject"
$ref: "#/components/schemas/BaseObject"
Locations:
description: Location of the content item.
type:
$ref: "#/components/schemas/BaseObject"
$ref: "#/components/schemas/BaseObject"
Owner:
description: The owner of the content item.
type:
$ref: "#/components/schemas/BaseObject"
$ref: "#/components/schemas/BaseObject"
lastModificationDate:
description: Content item modification date.
type: string
Expand All @@ -81,8 +75,7 @@ schemas:
type: string
ObjectStates:
description: Object states.
type:
$ref: "#/components/schemas/BaseObject"
$ref: "#/components/schemas/BaseObject"
ContentWrapper:
type: object
required:
Expand All @@ -101,14 +94,12 @@ schemas:
properties:
ContentType:
description: The content type for which the new content item is created.
type:
oneOf:
- "#/components/schemas/Content"
- "#/components/schemas/Href"
oneOf:
- "#/components/schemas/Content"
- "#/components/schemas/Href"
Section:
description: The Section the content item is assigned to. If not set the Section of the parent is used or a default Section.
type:
$ref: "#/components/schemas/Href"
$ref: "#/components/schemas/Href"
User:
description: The owner of the content. If not given the current authenticated User is set as owner.
type: integer
Expand Down Expand Up @@ -157,14 +148,11 @@ schemas:
mainLanguageCode:
type: string
Section:
type:
$ref: "#/components/schemas/Section"
$ref: "#/components/schemas/Section"
MainLocation:
type:
$ref: "#/components/schemas/Location"
$ref: "#/components/schemas/Location"
Owner:
type:
$ref: "#/components/schemas/User"
$ref: "#/components/schemas/User"
alwaysAvailable:
type: boolean
remoteId:
Expand All @@ -179,8 +167,7 @@ schemas:
properties:
Content:
description: Content ID matcher class.
type:
$ref: "#/components/schemas/Content"
$ref: "#/components/schemas/Content"
ContentInfoWrapper:
type: object
required:
Expand Down Expand Up @@ -290,8 +277,7 @@ schemas:
format: date-time
Creator:
description: Creator of the version, in the search API this is referred to as the modifier of the published content.
type:
$ref: "#/components/schemas/BaseObject"
$ref: "#/components/schemas/BaseObject"
creationDate:
description: Content creation date.
type: string
Expand All @@ -306,12 +292,10 @@ schemas:
description: Translation information.
names:
description: Names.
type:
$ref: "#/components/schemas/ValueArray"
$ref: "#/components/schemas/ValueArray"
Content:
description: Represents a content item in a specific version.
type:
$ref: "#/components/schemas/BaseObject"
$ref: "#/components/schemas/BaseObject"
Version:
allOf:
- $ref: "#/components/schemas/BaseObject"
Expand Down Expand Up @@ -407,11 +391,9 @@ schemas:
properties:
Version:
description: Returns the VersionInfo for this version.
type:
$ref: "#/components/schemas/BaseObject"
$ref: "#/components/schemas/BaseObject"
VersionInfo:
type:
$ref: "#/components/schemas/VersionInfo"
$ref: "#/components/schemas/VersionInfo"
VersionTranslationInfo:
description: Translation information.
type: object
Expand Down Expand Up @@ -445,12 +427,10 @@ schemas:
properties:
SourceContent:
description: The content of the source content of the relation.
type:
$ref: "#/components/schemas/Ref"
$ref: "#/components/schemas/Ref"
DestinationContent:
description: The content of the destination content of the relation.
type:
$ref: "#/components/schemas/Ref"
$ref: "#/components/schemas/Ref"
RelationType:
description: "The relation type bitmask. Relations: Relation::COMMON = 1, Relation::EMBED = 2, Relation::LINK = 4, Relation::FIELD = 8, Relation::ASSET = 16"
type: string
Expand All @@ -467,8 +447,7 @@ schemas:
- Destination
properties:
Destination:
type:
$ref: "#/components/schemas/Href"
$ref: "#/components/schemas/Href"
RelationCreateWrapper:
type: object
required:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ schemas:
$ref: "#/components/schemas/Trash"
TrashItem:
description: This class represents a trash item, which is actually a trashed Location.
type:
$ref: "#/components/schemas/Location"
$ref: "#/components/schemas/Location"
TrashItemWrapper:
type: object
required:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,13 @@ schemas:
format: date-time
Creator:
description: Creator User ID.
type:
$ref: "#/components/schemas/BaseObject"
$ref: "#/components/schemas/BaseObject"
Modifier:
description: Modifier User ID.
type:
$ref: "#/components/schemas/BaseObject"
$ref: "#/components/schemas/BaseObject"
ContentTypes:
description: Content types.
type:
$ref: "#/components/schemas/BaseObject"
$ref: "#/components/schemas/BaseObject"
ContentTypeGroupWrapper:
type: object
required:
Expand Down Expand Up @@ -81,8 +78,7 @@ schemas:
- ContentTypeGroupRef
properties:
ContentTypeGroupRef:
type:
$ref: "#/components/schemas/ContentTypeGroupRef"
$ref: "#/components/schemas/ContentTypeGroupRef"
ContentTypeGroupList:
allOf:
- $ref: "#/components/schemas/BaseObject"
Expand Down
Loading
Loading