diff --git a/openapi/components/schemas/NotificationV2.yaml b/openapi/components/schemas/NotificationV2.yaml index 2c49e257..fd709d3e 100644 --- a/openapi/components/schemas/NotificationV2.yaml +++ b/openapi/components/schemas/NotificationV2.yaml @@ -10,13 +10,24 @@ properties: type: string format: date-time data: - type: object - example: - OneOf: - - {} - - NotificationV2DataBoop - - NotificationV2DataEventAnnouncement - - NotificationV2DataGroupAnnouncement + x-if: + when: jsonschema + then: + oneOf: + - $ref: ./NotificationV2DataBoop.yaml + - $ref: ./NotificationV2DataEventAnnouncement.yaml + - $ref: ./NotificationV2DataGroupAnnouncement.yaml + - type: object + properties: { } + additionalProperties: false + else: + type: object + example: + OneOf: + - {} + - NotificationV2DataBoop + - NotificationV2DataEventAnnouncement + - NotificationV2DataGroupAnnouncement expiresAt: type: string format: date-time diff --git a/openapi/components/schemas/ProductListing.yaml b/openapi/components/schemas/ProductListing.yaml index a42c6679..197d49d0 100644 --- a/openapi/components/schemas/ProductListing.yaml +++ b/openapi/components/schemas/ProductListing.yaml @@ -58,8 +58,15 @@ properties: products: type: array items: - type: object description: Either a ProductID or a Product, depending on hydration + x-if: + when: jsonschema + then: + oneOf: + - $ref: ./Product.yaml + - $ref: ./ProductID.yaml + else: + type: object quantifiable: type: boolean recurrable: diff --git a/openapi/components/schemas/SentNotification.yaml b/openapi/components/schemas/SentNotification.yaml index ed57bb71..364f592b 100644 --- a/openapi/components/schemas/SentNotification.yaml +++ b/openapi/components/schemas/SentNotification.yaml @@ -6,16 +6,30 @@ properties: type: string format: date-time details: - type: object - example: - OneOf: - - {} - - NotificationDetailBoop - - NotificationDetailInvite - - NotificationDetailInviteResponse - - NotificationDetailRequestInvite - - NotificationDetailRequestInviteResponse - - NotificationDetailVoteToKick + x-if: + when: jsonschema + then: + oneOf: + - $ref: ../schemas/NotificationDetailBoop.yaml + - $ref: ../schemas/NotificationDetailInvite.yaml + - $ref: ../schemas/NotificationDetailInviteResponse.yaml + - $ref: ../schemas/NotificationDetailRequestInvite.yaml + - $ref: ../schemas/NotificationDetailRequestInviteResponse.yaml + - $ref: ../schemas/NotificationDetailVoteToKick.yaml + - type: object + properties: { } + additionalProperties: false + else: + type: object + example: + OneOf: + - {} + - NotificationDetailBoop + - NotificationDetailInvite + - NotificationDetailInviteResponse + - NotificationDetailRequestInvite + - NotificationDetailRequestInviteResponse + - NotificationDetailVoteToKick id: type: string minLength: 1 diff --git a/openapi/components/schemas/Transaction.yaml b/openapi/components/schemas/Transaction.yaml index cc14489a..d0cb56be 100644 --- a/openapi/components/schemas/Transaction.yaml +++ b/openapi/components/schemas/Transaction.yaml @@ -3,7 +3,14 @@ type: object description: "" properties: agreement: - $ref: ./TransactionAgreement.yaml + x-if: + when: jsonschema + then: + oneOf: + - $ref: ./TransactionAgreement.yaml + - type: string + else: + $ref: ./TransactionAgreement.yaml created_at: type: string format: date-time