From 22ba69db70c06a427f79d3efc20379607a24a955 Mon Sep 17 00:00:00 2001 From: Zach Daniel Date: Sun, 10 Dec 2023 12:59:32 -0500 Subject: [PATCH] fix: add back in api level verifiers I have no idea how or why these were removed, but it shouldn't have happened --- lib/ash/api/dsl.ex | 8 +++++++- .../api/verifiers/validate_related_resource_inclusion.ex | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/ash/api/dsl.ex b/lib/ash/api/dsl.ex index 4cd1ba869..21531e985 100644 --- a/lib/ash/api/dsl.ex +++ b/lib/ash/api/dsl.ex @@ -138,6 +138,12 @@ defmodule Ash.Api.Dsl do @sections [@api, @resources, @execution, @authorization] + @verifiers [ + Ash.Api.Verifiers.EnsureNoEmbeds, + Ash.Api.Verifiers.EnsureResourcesCompiled, + Ash.Api.Verifiers.ValidateRelatedResourceInclusion + ] + @moduledoc """ Apis are the entrypoints for working with your resources. @@ -148,5 +154,5 @@ defmodule Ash.Api.Dsl do environment variables called `:ash_apis` and `:ash_registries` to find any potential registries """ - use Spark.Dsl.Extension, sections: @sections + use Spark.Dsl.Extension, sections: @sections, verifiers: @verifiers end diff --git a/lib/ash/api/verifiers/validate_related_resource_inclusion.ex b/lib/ash/api/verifiers/validate_related_resource_inclusion.ex index 4cbaeb269..c328507a3 100644 --- a/lib/ash/api/verifiers/validate_related_resource_inclusion.ex +++ b/lib/ash/api/verifiers/validate_related_resource_inclusion.ex @@ -11,6 +11,7 @@ defmodule Ash.Api.Verifiers.ValidateRelatedResourceInclusion do dsl |> Verifier.get_entities([:resources]) |> Enum.map(& &1.resource) + |> IO.inspect() for resource <- resources do for relationship <- Ash.Resource.Info.relationships(resource) do