Packages

IntegrateDB is a database sharing system. It provides integration primitives and data ownership and migration controls. Use it to integrate applications directly through a Postgres database.

Current section

Files

Jump to
integratedb lib integrate_web views specification_view.ex
Raw

lib/integrate_web/views/specification_view.ex

defmodule IntegrateWeb.SpecificationView do
use IntegrateWeb, :view
alias Integrate.Specification.Spec
alias Integrate.SpecificationData
def render("show.json", %{spec: spec}) do
%{match: matches} = SpecificationData.contract(spec)
%{
data: %{
type: spec.type,
match: matches
}
}
end
def render("show_empty.json", %{type: type}) do
%{
data: %{
type: Spec.types(type),
match: []
}
}
end
end