mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-23 08:36:29 +00:00
OpenAPI: make it possible to generate a spec without starting the app
Needed for api docs generation on pleroma.social that will come later
This commit is contained in:
parent
51116b5392
commit
4b12e071ac
1 changed files with 9 additions and 4 deletions
|
@ -13,10 +13,15 @@ defmodule Pleroma.Web.ApiSpec do
|
|||
@impl OpenApi
|
||||
def spec do
|
||||
%OpenApi{
|
||||
servers: [
|
||||
# Populate the Server info from a phoenix endpoint
|
||||
OpenApiSpex.Server.from_endpoint(Endpoint)
|
||||
],
|
||||
servers:
|
||||
if Phoenix.Endpoint.server?(:pleroma, Endpoint) do
|
||||
[
|
||||
# Populate the Server info from a phoenix endpoint
|
||||
OpenApiSpex.Server.from_endpoint(Endpoint)
|
||||
]
|
||||
else
|
||||
[]
|
||||
end,
|
||||
info: %OpenApiSpex.Info{
|
||||
title: "Pleroma",
|
||||
description: Application.spec(:pleroma, :description) |> to_string(),
|
||||
|
|
Loading…
Reference in a new issue