Tama.Dex.Profile.Issue (tama_dex v0.1.0)

Copy Markdown View Source

A defect found by Tama.Dex.Profile.validate/1.

  • pointer is the JSON Pointer (RFC 6901) of the offending value, or of where a missing value belongs. "" is the whole document.
  • code is a stable atom. Match on it, not on the message.
  • message is human-readable text of at most 256 bytes.

Codes

CodeMeaning
:invalid_documentThe document isn't a JSON object.
:invalid_jsonA value isn't JSON data (for example an atom, a tuple or a non-string key).
:unsupported_profilex-tama-profile is missing or isn't tama-operations/1.
:document_too_largeThe serialized document is over 4 MiB.
:too_many_operationsThe document holds more than 1024 operations.
:missing_fieldA required field is absent.
:invalid_fieldA field has the wrong type or value.
:unknown_fieldA field the profile doesn't allow is present.
:unknown_extensionAn x-tama-* key this profile version doesn't define is present.
:invalid_pathA path isn't /operations/{operationId}.
:operation_id_mismatchThe path suffix isn't the operation's operationId.
:duplicate_operation_idAn operationId appears more than once in the document.
:invalid_input_schemaThe request body schema isn't an object schema.
:invalid_confirmationx-tama-confirmation.field isn't a required top-level string property of the input schema.
:invalid_identityAn x-tama-identity name isn't a top-level property of the 200 or default schema.
:extensions_too_largeAn operation's other x- extensions are over 16 KiB.
:external_referenceA $ref points outside the document.
:invalid_referenceA $ref isn't a pointer into #/components/schemas/, or a schema declares $id.
:unresolved_referenceA $ref points at nothing.
:schema_too_largeA request or response schema, with the components it references, is over 256 KiB.
:schema_compile_failedA request or response schema doesn't compile as JSON Schema 2020-12.

Summary

Types

code()

@type code() ::
  :invalid_document
  | :invalid_json
  | :unsupported_profile
  | :document_too_large
  | :too_many_operations
  | :missing_field
  | :invalid_field
  | :unknown_field
  | :unknown_extension
  | :invalid_path
  | :operation_id_mismatch
  | :duplicate_operation_id
  | :invalid_input_schema
  | :invalid_confirmation
  | :invalid_identity
  | :extensions_too_large
  | :external_reference
  | :invalid_reference
  | :unresolved_reference
  | :schema_too_large
  | :schema_compile_failed

t()

@type t() :: %Tama.Dex.Profile.Issue{
  code: code(),
  message: String.t(),
  pointer: String.t()
}