Kim Alvefur <zash@zash.se> [Fri, 08 Jul 2022 19:43:47 +0200] rev 12587
Merge 0.12->trunk
Kim Alvefur <zash@zash.se> [Fri, 08 Jul 2022 19:42:48 +0200] rev 12586
Backport 875f73ead4e8 8e4033213c62 to deal with luacheck 0.26
Kim Alvefur <zash@zash.se> [Fri, 08 Jul 2022 19:36:07 +0200] rev 12585
Merge 0.12->trunk
Kim Alvefur <zash@zash.se> [Fri, 08 Jul 2022 17:32:48 +0200] rev 12584
util.datamapper: Improve handling of schemas with non-obvious "type"
The JSON Schema specification says that schemas are objects or booleans,
and that the 'type' property is optional and can be an array.
This module previously allowed bare type names as schemas and did not
really handle booleans.
It now handles missing 'type' properties and boolean 'true' as a schema.
Objects and arrays are guessed based on the presence of 'properties' or
'items' field.
Kim Alvefur <zash@zash.se> [Fri, 08 Jul 2022 14:38:23 +0200] rev 12583
util.jsonschema: Fix validation to not assume presence of "type" field
MattJ reported a curious issue where validation did not work as
expected. Primarily that the "type" field was expected to be mandatory,
and thus leaving it out would result in no checks being performed.
This was likely caused by misreading during initial development.
Spent some time testing against
https://github.com/json-schema-org/JSON-Schema-Test-Suite.git and
discovered a multitude of issues, far too many to bother splitting into
separate commits.
More than half of them fail. Many because of features not implemented,
which have been marked NYI. For example, some require deep comparisons
e.g. when objects or arrays are present in enums fields.
Some because of quirks with how Lua differs from JavaScript, e.g. no
distinct array or object types. Tests involving fractional floating
point numbers. We're definitely not going to follow references to remote
resources. Or deal with UTF-16 sillyness. One test asserted that 1.0 is
an integer, where Lua 5.3+ will disagree.
Kim Alvefur <zash@zash.se> [Sat, 02 Jul 2022 17:27:39 +0200] rev 12582
executables: Reject Lua 5.1 early
Prevents attempting to load libraries that may no longer be found and
crashing with a traceback.
Platforms like Debian where multiple Lua versions can be installed at
the same time and 'lua' pointing to one of the installed interpreters
via symlinks, there's the possibility that prosody/prosodyctl may be
invoked with Lua 5.1, which will no longer have any of the rest of
Prosody libraries available to be require(), and thus would immediately
fail with an unfriendly traceback.
Checking and aborting early with a friendlier message and reference to
more information is better.
Part of #1600
Kim Alvefur <zash@zash.se> [Tue, 05 Jul 2022 14:59:47 +0200] rev 12581
CHANGES: Lua 5.1 support removed (closes #1600)
Kim Alvefur <zash@zash.se> [Tue, 05 Jul 2022 14:18:32 +0200] rev 12580
util.envload: Remove Lua 5.1 method
Part of #1600
Is this module even needed anymore?
Kim Alvefur <zash@zash.se> [Fri, 01 Jul 2022 21:21:21 +0200] rev 12579
util-src: Remove Lua 5.1 compat macros
Part of #1600
Kim Alvefur <zash@zash.se> [Sat, 02 Jul 2022 17:30:06 +0200] rev 12578
mod_storage_sql: Remove Lua 5.1 compatibility hack
Part of #1600