category

http_json_term_helpers

Internal shared helpers for the repository-standard JSON term representation used by the HTTP, OpenAPI, and HTTP router libraries.

Availability:
logtalk_load(http_core(loader))
Author: Paulo Moura
Version: 1:0:0
Date: 2026-05-23
Compilation flags:
static
Dependencies:
(none)
Remarks:
(none)
Inherited public predicates:
(none)

Public predicates

(none)

Protected predicates

json_object_pairs/2

Converts between supported JSON object term representations and a flat list of key-value pairs.

Compilation flags:
static
Template:
json_object_pairs(Object,Pairs)
Mode and number of proofs:
json_object_pairs(+term,-list(compound)) - zero_or_one
json_object_pairs(-term,+list(compound)) - one

pairs_to_object/2

Converts a list of JSON object key-value pairs into the repository-standard object representation.

Compilation flags:
static
Template:
pairs_to_object(Pairs,Object)
Mode and number of proofs:
pairs_to_object(+list(compound),-term) - one

curly_pairs_to_list/2

Converts a nested curly-pair term into a plain list of pairs.

Compilation flags:
static
Template:
curly_pairs_to_list(CurlyPairs,Pairs)
Mode and number of proofs:
curly_pairs_to_list(+compound,-list(compound)) - one

list_to_curly_pairs/2

Converts a plain list of pairs into the nested curly-pair representation.

Compilation flags:
static
Template:
list_to_curly_pairs(Pairs,CurlyPairs)
Mode and number of proofs:
list_to_curly_pairs(+list(compound),-compound) - one

pair_key_value/3

Normalizes supported key-value pair syntaxes into explicit key and value terms.

Compilation flags:
static
Template:
pair_key_value(Pair,Key,Value)
Mode and number of proofs:
pair_key_value(+compound,-term,-term) - one

normalize_json_value/2

Normalizes arbitrary JSON-like values into the repository-standard JSON representation, including booleans and null.

Compilation flags:
static
Template:
normalize_json_value(Value,JsonValue)
Mode and number of proofs:
normalize_json_value(+term,-term) - one

normalize_json_pairs/2

Normalizes the values of a JSON object pair list into the repository-standard JSON representation.

Compilation flags:
static
Template:
normalize_json_pairs(Pairs,JsonPairs)
Mode and number of proofs:
normalize_json_pairs(+list(compound),-list(compound)) - one

Private predicates

(none)

Operators

(none)