Commit Graph

14 Commits

Author SHA1 Message Date
Mark Felder 4a9ed4682a Revert "Pleroma.Web.PleromaAPI.EmojiFileController: dialyzer errors"
This reverts commit dc912dc590.
2024-01-30 14:15:17 -05:00
Mark Felder dc912dc590 Pleroma.Web.PleromaAPI.EmojiFileController: dialyzer errors
lib/pleroma/web/pleroma_api/controllers/emoji_file_controller.ex:52:no_return
Function update/2 has no local return.
________________________________________________________________________________
lib/pleroma/web/pleroma_api/controllers/emoji_file_controller.ex:59:call
The function call will not succeed.

Phoenix.Controller.json(_conn :: %{:body_params => %{:shortcode => _, _ => _}, _ => _}, %{
  binary() =>
    binary()
    | maybe_improper_list(
        binary() | maybe_improper_list(any(), binary() | []) | char(),
        binary() | []
      )
})

breaks the contract
(Plug.Conn.t(), term()) :: Plug.Conn.t()

________________________________________________________________________________
lib/pleroma/web/pleroma_api/controllers/emoji_file_controller.ex:62:call
The function call will not succeed.

Plug.Conn.put_status(_conn :: %{:body_params => %{:shortcode => _, _ => _}, _ => _}, :conflict)

breaks the contract
(t(), status()) :: t()

________________________________________________________________________________
lib/pleroma/web/pleroma_api/controllers/emoji_file_controller.ex:70:call
The function call will not succeed.

Plug.Conn.put_status(_conn :: %{:body_params => %{:shortcode => _, _ => _}, _ => _}, :unprocessable_entity) ::
  :ok
def a() do
  :ok
end

breaks the contract
(t(), status()) :: t()

________________________________________________________________________________
lib/pleroma/web/pleroma_api/controllers/emoji_file_controller.ex:75:call
The function call will not succeed.

Pleroma.Web.PleromaAPI.EmojiFileController.handle_error(
  _conn :: %{:body_params => %{:shortcode => _, _ => _}, _ => _},
  _error :: {:error, atom()},
  %{:code => _, :message => <<_::328>>, :pack_name => binary()}
)

will never return since the 1st arguments differ
from the success typing arguments:

(
  %Plug.Conn{
    :adapter => {atom(), _},
    :assigns => %{atom() => _},
    :body_params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :halted => boolean(),
    :host => binary(),
    :method => binary(),
    :owner => pid(),
    :params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :path_info => [binary()],
    :path_params => %{
      binary() =>
        binary() | [binary() | [any()] | map()] | %{binary() => binary() | [any()] | map()}
    },
    :port => char(),
    :private => %{atom() => _},
    :query_params => %Plug.Conn.Unfetched{
      :aspect => atom(),
      binary() =>
        binary() | [binary() | [any()] | map()] | %{binary() => binary() | [any()] | map()}
    },
    :query_string => binary(),
    :remote_ip =>
      {byte(), byte(), byte(), byte()}
      | {char(), char(), char(), char(), char(), char(), char(), char()},
    :req_cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => binary()},
    :req_headers => [{binary(), binary()}],
    :request_path => binary(),
    :resp_body =>
      nil
      | binary()
      | maybe_improper_list(
          binary() | maybe_improper_list(any(), binary() | []) | byte(),
          binary() | []
        ),
    :resp_cookies => %{binary() => map()},
    :resp_headers => [{binary(), binary()}],
    :scheme => :http | :https,
    :script_name => [binary()],
    :secret_key_base => nil | binary(),
    :state =>
      :chunked | :file | :sent | :set | :set_chunked | :set_file | :unset | :upgraded,
    :status => nil | non_neg_integer()
  },
  {:error, atom()},
  %{:message => <<_::328, _::size(88)>>, :pack_name => binary(), :code => _}
)

________________________________________________________________________________
lib/pleroma/web/pleroma_api/controllers/emoji_file_controller.ex:75:call
The function call will not succeed.

Pleroma.Web.PleromaAPI.EmojiFileController.handle_error(
  _conn :: %{:body_params => %{:shortcode => _, _ => _}, _ => _},
  _error :: {:error, atom()},
  %{:code => binary(), :message => <<_::328>>, :pack_name => binary()}
)

will never return since the 1st arguments differ
from the success typing arguments:

(
  %Plug.Conn{
    :adapter => {atom(), _},
    :assigns => %{atom() => _},
    :body_params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :halted => boolean(),
    :host => binary(),
    :method => binary(),
    :owner => pid(),
    :params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :path_info => [binary()],
    :path_params => %{
      binary() =>
        binary() | [binary() | [any()] | map()] | %{binary() => binary() | [any()] | map()}
    },
    :port => char(),
    :private => %{atom() => _},
    :query_params => %Plug.Conn.Unfetched{
      :aspect => atom(),
      binary() =>
        binary() | [binary() | [any()] | map()] | %{binary() => binary() | [any()] | map()}
    },
    :query_string => binary(),
    :remote_ip =>
      {byte(), byte(), byte(), byte()}
      | {char(), char(), char(), char(), char(), char(), char(), char()},
    :req_cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => binary()},
    :req_headers => [{binary(), binary()}],
    :request_path => binary(),
    :resp_body =>
      nil
      | binary()
      | maybe_improper_list(
          binary() | maybe_improper_list(any(), binary() | []) | byte(),
          binary() | []
        ),
    :resp_cookies => %{binary() => map()},
    :resp_headers => [{binary(), binary()}],
    :scheme => :http | :https,
    :script_name => [binary()],
    :secret_key_base => nil | binary(),
    :state =>
      :chunked | :file | :sent | :set | :set_chunked | :set_file | :unset | :upgraded,
    :status => nil | non_neg_integer()
  },
  {:error, atom()},
  %{:message => <<_::328, _::size(88)>>, :pack_name => binary(), :code => _}
)
2024-01-28 15:52:09 -05:00
tusooa bddcb3ed68
Add names to additionalProperties 2023-01-15 17:28:32 -05:00
lain e853cfe7c3 Revert "Merge branch 'copyright-bump' into 'develop'"
This reverts merge request !3825
2023-01-02 20:38:50 +00:00
marcin mikołajczak 10886eeaa2 Bump copyright year
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2023-01-01 12:13:06 +01:00
Sean King 17aa3644be
Copyright bump for 2022 2022-02-25 23:11:42 -07:00
rinpatch 95a22c1cc2 OpenAPI: Add `admin:` scope prefix to admin operations
Also splits "Emoji packs" to two categories: "Emoji pack administration"
and "Emoji packs"
2021-02-17 21:10:28 +03:00
rinpatch 9fcff7851f Improve OpenAPI spec and deploy it to api.pleroma.social
Too many changes in OpenAPI spec to describe each one, but
basically it is tag fixes, bringing consitency to operation summaries
and fixing some incorrect information.
2021-02-03 16:07:44 +03:00
Haelwenn (lanodan) Monnier c4439c630f
Bump Copyright to 2021
grep -rl '# Copyright © .* Pleroma' * | xargs sed -i 's;Copyright © .* Pleroma .*;Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>;'
2021-01-13 07:49:50 +01:00
Maksim Pechnikov e4b202d905 added test 2020-11-16 22:23:28 +03:00
Alexander Strizhakov 5d7ec00bed
fixes after rebase 2020-09-24 09:42:30 +03:00
Maksim Pechnikov 0922791e4d updated errors on add emoji 2020-08-22 10:56:26 +03:00
Maksim Pechnikov f5845ff033 upload emoji zip file 2020-08-22 10:42:02 +03:00
Maksim Pechnikov 7794d7c694 added Pleroma.Web.PleromaAPI.EmojiFileController 2020-08-19 06:50:20 +03:00