From b5a92b119955939b5c0be0cf3fd5119ad31a2adf Mon Sep 17 00:00:00 2001 From: William Pitcock <nenolod@dereferenced.org> Date: Thu, 16 Aug 2018 23:36:35 +0000 Subject: [PATCH 1/2] mastodon api: add undocumented fields to json response, return app id as string like mastodon itself does --- lib/pleroma/web/mastodon_api/mastodon_api_controller.ex | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex index cd9525252..d3b95e793 100644 --- a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex +++ b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex @@ -19,9 +19,12 @@ def create_app(conn, params) do with cs <- App.register_changeset(%App{}, params) |> IO.inspect(), {:ok, app} <- Repo.insert(cs) |> IO.inspect() do res = %{ - id: app.id, + id: app.id |> to_string, + name: app.name, client_id: app.client_id, - client_secret: app.client_secret + client_secret: app.client_secret, + redirect_uris: app.redirect_uris, + website: app.website } json(conn, res) From a3ef2ebb35901532fbf3fb754ae5a2832ed31a2b Mon Sep 17 00:00:00 2001 From: William Pitcock <nenolod@dereferenced.org> Date: Thu, 16 Aug 2018 23:49:35 +0000 Subject: [PATCH 2/2] mastodon api controller: client_name, not name --- lib/pleroma/web/mastodon_api/mastodon_api_controller.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex index d3b95e793..f17e2eda2 100644 --- a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex +++ b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex @@ -20,7 +20,7 @@ def create_app(conn, params) do {:ok, app} <- Repo.insert(cs) |> IO.inspect() do res = %{ id: app.id |> to_string, - name: app.name, + name: app.client_name, client_id: app.client_id, client_secret: app.client_secret, redirect_uris: app.redirect_uris,