1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.ApiSpec.Helpers do
6 def request_body(description, schema_ref, opts \\ []) do
7 media_types = ["application/json", "multipart/form-data"]
11 |> Enum.map(fn type ->
13 %OpenApiSpex.MediaType{
15 example: opts[:example],
16 examples: opts[:examples]
21 %OpenApiSpex.RequestBody{
22 description: description,
24 required: opts[:required] || false