All checks were successful
Build and Publish / build-release (push) Successful in 3m7s
39 lines
1.1 KiB
Elixir
39 lines
1.1 KiB
Elixir
defmodule CustomerServiceWeb.ApiSpec do
|
|
alias OpenApiSpex.{OpenApi, Info, Server, Components, SecurityScheme}
|
|
alias OpenApiSpex.{Info, OpenApi, Paths, Server}
|
|
alias CustomerServiceWeb.{Endpoint, Router}
|
|
@behaviour OpenApi
|
|
|
|
@impl OpenApi
|
|
def spec do
|
|
%OpenApi{
|
|
servers: [
|
|
Server.from_endpoint(Endpoint)
|
|
],
|
|
info: %Info{
|
|
title: "Customer Service",
|
|
version: "1.0"
|
|
},
|
|
paths: Paths.from_router(Router),
|
|
components: %Components{
|
|
securitySchemes: %{
|
|
"bearerAuth" => %SecurityScheme{
|
|
type: "http",
|
|
scheme: "bearer",
|
|
bearerFormat: "JWT",
|
|
description: "Zitadel JWT bearer token for authentication"
|
|
},
|
|
"x-organization-id" => %SecurityScheme{
|
|
type: "apiKey",
|
|
in: "header",
|
|
name: "x-organization-id",
|
|
description: "Organization identifier for tenant isolation"
|
|
}
|
|
}
|
|
},
|
|
security: [%{"bearerAuth" => [], "x-organization-id" => []}]
|
|
}
|
|
|> OpenApiSpex.resolve_schema_modules()
|
|
end
|
|
end
|