This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
defmodule ProviderServiceWeb.ApiSpec do
|
||||
alias OpenApiSpex.{OpenApi, Info, Server}
|
||||
alias OpenApiSpex.{OpenApi, Info, Server, Components, SecurityScheme}
|
||||
alias OpenApiSpex.{Info, OpenApi, Paths, Server}
|
||||
alias ProviderServiceWeb.{Endpoint, Router}
|
||||
|
||||
@@ -17,7 +17,24 @@ defmodule ProviderServiceWeb.ApiSpec do
|
||||
version: "1.0"
|
||||
},
|
||||
# Populate the paths from a phoenix router
|
||||
paths: Paths.from_router(Router)
|
||||
paths: Paths.from_router(Router),
|
||||
components: %Components{
|
||||
securitySchemes: %{
|
||||
"bearerAuth" => %SecurityScheme{
|
||||
type: "http",
|
||||
scheme: "bearer",
|
||||
bearerFormat: "JWT",
|
||||
description: "Zitadel JWT bearer token"
|
||||
},
|
||||
"x-organization-id" => %SecurityScheme{
|
||||
type: "apiKey",
|
||||
in: "header",
|
||||
name: "x-organization-id",
|
||||
description: "Organization identifier"
|
||||
}
|
||||
}
|
||||
},
|
||||
security: [%{"bearerAuth" => [], "x-organization-id" => []}]
|
||||
}
|
||||
# Discover request/response schemas from path specs
|
||||
|> OpenApiSpex.resolve_schema_modules()
|
||||
|
||||
Reference in New Issue
Block a user