Current section
Files
Jump to
Current section
Files
src/nori@ref@types.erl
-module(nori@ref@types).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
-define(FILEPATH, "src/nori/ref/types.gleam").
-export([new_context/2]).
-export_type([ref_context/0, ref_error/0, parsed_ref/0]).
-if(?OTP_RELEASE >= 27).
-define(MODULEDOC(Str), -moduledoc(Str)).
-define(DOC(Str), -doc(Str)).
-else.
-define(MODULEDOC(Str), -compile([])).
-define(DOC(Str), -compile([])).
-endif.
?MODULEDOC(" Types for $ref resolution across OpenAPI specification files.\n").
-type ref_context() :: {ref_context,
binary(),
gleam@dict:dict(binary(), taffy@value:yaml_value()),
gleam@set:set(binary()),
taffy@value:yaml_value()}.
-type ref_error() :: {file_not_found, binary()} |
{parse_error, binary(), binary()} |
{circular_reference, list(binary())} |
{invalid_ref_format, binary()} |
{ref_target_not_found, binary(), binary()}.
-type parsed_ref() :: {local_ref, list(binary())} |
{file_ref, binary()} |
{file_ref_with_pointer, binary(), list(binary())}.
-file("src/nori/ref/types.gleam", 22).
?DOC(" Creates a new RefContext for resolving refs from a given base directory.\n").
-spec new_context(binary(), taffy@value:yaml_value()) -> ref_context().
new_context(Base_dir, Root) ->
{ref_context, Base_dir, maps:new(), gleam@set:new(), Root}.