Skip to content

Commit

Permalink
API spec fixes (#159)
Browse files Browse the repository at this point in the history
* Don't start the app when generating API spec
* lint
* Fix api spec not being versioned
* fix
  • Loading branch information
sgfn authored Feb 28, 2024
1 parent d4a0f77 commit 6de98af
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lib/jellyfish_web/api_spec.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ defmodule JellyfishWeb.ApiSpec do

alias OpenApiSpex.{Components, Info, License, Paths, Schema, SecurityScheme}

@version Mix.Project.config()[:version]

# OpenAPISpex master specification

@impl OpenApiSpex.OpenApi
def spec() do
%OpenApiSpex.OpenApi{
info: %Info{
title: "Jellyfish Media Server",
version: "0.2.0",
version: @version,
license: %License{
name: "Apache 2.0",
url: "https://www.apache.org/licenses/LICENSE-2.0"
Expand Down
8 changes: 7 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,13 @@ defmodule Jellyfish.MixProject do
{_io_stream, exit_status} =
System.cmd(
"mix",
["openapi.spec.yaml", "--spec", "JellyfishWeb.ApiSpec", generated_filename],
[
"openapi.spec.yaml",
"--start-app=false",
"--spec",
"JellyfishWeb.ApiSpec",
generated_filename
],
into: IO.stream()
)

Expand Down
2 changes: 1 addition & 1 deletion openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ info:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0
title: Jellyfish Media Server
version: 0.2.0
version: 0.4.0
openapi: 3.0.0
paths:
/health:
Expand Down

0 comments on commit 6de98af

Please sign in to comment.