NLdoc.Spec.Validation.Finding (NLdoc.Spec.Validation v1.0.15)
View SourceThis module defines the Ecto schema for the NLdoc Validation spec Validation object.
Summary
Functions
This function creates a new NLdoc.Spec.Validation.Finding
struct from a map of keys and values, where the keys are snake_case.
Returns a tuple with either {:ok, finding}
or {:error, changeset}
.
Types
@type t() :: %NLdoc.Spec.Validation.Finding{ resource_id: Ecto.UUID.t(), rule: String.t(), ruleset: String.t(), ruleset_version: String.t(), severity: :error | :warning | :notice, type: String.t() }
Functions
@spec changeset( struct(), map() ) :: Ecto.Changeset.t()
@spec new(map()) :: {:ok, t()} | {:error, Ecto.Changeset.t()}
This function creates a new NLdoc.Spec.Validation.Finding
struct from a map of keys and values, where the keys are snake_case.
Returns a tuple with either {:ok, finding}
or {:error, changeset}
.
Note: If you want to use a map with camelCase keys, use NLdoc.Util.Recase.to_snake/1
to convert them to snake_case before passing them to the constructor.