summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2024-03-19 12:44:13 +0000
committerlain <lain@soykaf.club>2024-03-19 12:44:13 +0000
commitf775a1931b4f5625ad61fce8fabeb089375a80ac (patch)
tree25db7854e3d1b017a4abe2ae7b7687a744da82c6 /lib
parent4e37cd85ef5b1134913441166219f09220fd4942 (diff)
parent4e8a1b40cb7014a14d209d4438491a66246802b1 (diff)
downloadpleroma-f775a1931b4f5625ad61fce8fabeb089375a80ac.tar.gz
pleroma-f775a1931b4f5625ad61fce8fabeb089375a80ac.zip
Merge branch 'transient-validators-defaults' into 'develop'
Set defaults values on transient objects (attachment, poll options) validators See merge request pleroma/pleroma!4090
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/activity_pub/object_validators/attachment_validator.ex4
-rw-r--r--lib/pleroma/web/activity_pub/object_validators/question_options_validator.ex4
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/pleroma/web/activity_pub/object_validators/attachment_validator.ex b/lib/pleroma/web/activity_pub/object_validators/attachment_validator.ex
index 398020bff..72975f348 100644
--- a/lib/pleroma/web/activity_pub/object_validators/attachment_validator.ex
+++ b/lib/pleroma/web/activity_pub/object_validators/attachment_validator.ex
@@ -12,13 +12,13 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.AttachmentValidator do
@primary_key false
embedded_schema do
field(:id, :string)
- field(:type, :string)
+ field(:type, :string, default: "Link")
field(:mediaType, ObjectValidators.MIME, default: "application/octet-stream")
field(:name, :string)
field(:blurhash, :string)
embeds_many :url, UrlObjectValidator, primary_key: false do
- field(:type, :string)
+ field(:type, :string, default: "Link")
field(:href, ObjectValidators.Uri)
field(:mediaType, ObjectValidators.MIME, default: "application/octet-stream")
field(:width, :integer)
diff --git a/lib/pleroma/web/activity_pub/object_validators/question_options_validator.ex b/lib/pleroma/web/activity_pub/object_validators/question_options_validator.ex
index 541945fa4..8d7f7b9fa 100644
--- a/lib/pleroma/web/activity_pub/object_validators/question_options_validator.ex
+++ b/lib/pleroma/web/activity_pub/object_validators/question_options_validator.ex
@@ -14,10 +14,10 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.QuestionOptionsValidator do
embeds_one :replies, Replies, primary_key: false do
field(:totalItems, :integer)
- field(:type, :string)
+ field(:type, :string, default: "Collection")
end
- field(:type, :string)
+ field(:type, :string, default: "Note")
end
def changeset(struct, data) do