Merge branch 'transient-validators-defaults' into 'develop'
Set defaults values on transient objects (attachment, poll options) validators See merge request pleroma/pleroma!4090
This commit is contained in:
commit
f775a1931b
|
@ -0,0 +1 @@
|
||||||
|
Set default values on validators for transient objects (attachment, poll options)
|
|
@ -12,13 +12,13 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.AttachmentValidator do
|
||||||
@primary_key false
|
@primary_key false
|
||||||
embedded_schema do
|
embedded_schema do
|
||||||
field(:id, :string)
|
field(:id, :string)
|
||||||
field(:type, :string)
|
field(:type, :string, default: "Link")
|
||||||
field(:mediaType, ObjectValidators.MIME, default: "application/octet-stream")
|
field(:mediaType, ObjectValidators.MIME, default: "application/octet-stream")
|
||||||
field(:name, :string)
|
field(:name, :string)
|
||||||
field(:blurhash, :string)
|
field(:blurhash, :string)
|
||||||
|
|
||||||
embeds_many :url, UrlObjectValidator, primary_key: false do
|
embeds_many :url, UrlObjectValidator, primary_key: false do
|
||||||
field(:type, :string)
|
field(:type, :string, default: "Link")
|
||||||
field(:href, ObjectValidators.Uri)
|
field(:href, ObjectValidators.Uri)
|
||||||
field(:mediaType, ObjectValidators.MIME, default: "application/octet-stream")
|
field(:mediaType, ObjectValidators.MIME, default: "application/octet-stream")
|
||||||
field(:width, :integer)
|
field(:width, :integer)
|
||||||
|
|
|
@ -14,10 +14,10 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.QuestionOptionsValidator do
|
||||||
|
|
||||||
embeds_one :replies, Replies, primary_key: false do
|
embeds_one :replies, Replies, primary_key: false do
|
||||||
field(:totalItems, :integer)
|
field(:totalItems, :integer)
|
||||||
field(:type, :string)
|
field(:type, :string, default: "Collection")
|
||||||
end
|
end
|
||||||
|
|
||||||
field(:type, :string)
|
field(:type, :string, default: "Note")
|
||||||
end
|
end
|
||||||
|
|
||||||
def changeset(struct, data) do
|
def changeset(struct, data) do
|
||||||
|
|
Loading…
Reference in New Issue