Bug#1091856: libjson-validator-perl: Requires cache symlink for v3.0 schema

gregor herrmann gregoa at debian.org
Wed Jan 1 17:03:18 GMT 2025


Control: tag -1 + confirmed

On Wed, 01 Jan 2025 17:23:13 +0200, Wouter Verhelst wrote:

> Running 'strace -ff -o foo <application>; grep Validator.cache foo*' outputs:
> 
> foo.146500:newfstatat(AT_FDCWD, "/usr/share/perl5/JSON/Validator/cache/a516498b60c53096b2ce2cd83ebe0abc", 0x56545a8b14b8, 0) = -1 ENOENT (No such file or directory)
> 
> Creating a symlink with that name to
> '../../../../openapi-specificaction/schemas/v3.0/schema.yaml' resolves the
> issue.
> 
> Presumably a symlink for v1.2 and v3.1 should be created too, but I
> didn't immediately find out how the hash is computed, so I don't know
> which ones to use.

Hm, indeed, there's only a symlink for v2.0.


The symlinks should be created in d/rules:

execute_after_dh_install:
	find /usr/share/openapi-specification/schemas -name schema.json \
		| while read SCHEMA; \
		  do jq '.["id"]' $${SCHEMA} | tr -d '"' \
			| perl -pe 's/#?\n$$//' | md5sum | cut -d ' ' -f 1 \
			| xargs -i ln -s $${SCHEMA} debian/libjson-validator-perl/usr/share/perl5/JSON/Validator/cache/{}; \


In pratice this does not end so well because:

# find /usr/share/openapi-specification/schemas -name schema.json
/usr/share/openapi-specification/schemas/v2.0/schema.json


v3.0 and v3.1 have a schema.yml:

# find /usr/share/openapi-specification/ -name schema.yaml
/usr/share/openapi-specification/schemas/v3.1/schema.yaml
/usr/share/openapi-specification/schemas/v3.0/schema.yaml


For v1.2 probably
/usr/share/openapi-specification/schemas/v1.2/apiDeclaration.json
is the closest thing …


Cc'ing Andrius, who also maintains the openapi-specification package.


Cheers,
gregor


-- 
 .''`.  https://info.comodo.priv.at -- Debian Developer https://www.debian.org
 : :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D  85FA BB3A 6801 8649 AA06
 `. `'  Member VIBE!AT & SPI Inc. -- Supporter Free Software Foundation Europe
   `-   
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 963 bytes
Desc: Digital Signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-perl-maintainers/attachments/20250101/bee5525c/attachment.sig>


More information about the pkg-perl-maintainers mailing list