Skip to content

Commit

Permalink
Fix circular reference
Browse files Browse the repository at this point in the history
  • Loading branch information
Shreyaschorge committed Oct 23, 2024
1 parent 218ffc4 commit dc32020
Showing 1 changed file with 52 additions and 11 deletions.
63 changes: 52 additions & 11 deletions src/v2/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -679,17 +679,9 @@ components:
cast_id:
$ref: "#/components/schemas/CastId"
metadata:
$ref: "#/components/schemas/EmbedCastMetadataRef"
EmbedCastMetadataRef:
description: Reference to avoid circular reference in EmbedCastMetadata
anyOf:
- $ref: "#/components/schemas/Cast"
- type: object
properties:
embeds:
type: array
items:
type: object # Breaks the recursive reference
$ref: "#/components/schemas/EmbedCastMetadata"
EmbedCastMetadata:
$ref: "#/components/schemas/CastWithoutEmbeds"
Frame:
type: object
required:
Expand Down Expand Up @@ -1182,6 +1174,55 @@ components:
oneOf:
- $ref: "#/components/schemas/EmbedUrl"
- $ref: "#/components/schemas/EmbedCast"
CastWithoutEmbeds:
type: object
required:
- hash
- parent_hash
- parent_url
- root_parent_url
- parent_author
- author
- text
- timestamp
- type
properties:
hash:
type: string
parent_hash:
type: string
nullable: true
parent_url:
type: string
nullable: true
root_parent_url:
type: string
nullable: true
parent_author:
type: object
required:
- fid
properties:
fid:
allOf:
- $ref: "#/components/schemas/Fid"
nullable: true
author:
oneOf:
- $ref: "#/components/schemas/User"
- $ref: "#/components/schemas/UserDehydrated"
discriminator:
propertyName: object
mapping:
user: "#/components/schemas/User"
user_dehydrated: "#/components/schemas/UserDehydrated"
text:
type: string
timestamp:
$ref: "#/components/schemas/Timestamp"
type:
$ref: "#/components/schemas/CastNotificationType"
# Note: 'embeds' property is intentionally omitted to break the circular reference
Cast:
type: object
required:
Expand Down

0 comments on commit dc32020

Please sign in to comment.