H5P fails validation if the contents of the compressed archive contains empty directory paths or extra system files like .DS_store on Mac OS.

Using 7-zip command line tools on windows this this would be the command.

7z.exe a -tzip h5pTEST.h5p -ir!*.? -i!*.json

To view the contents of zip folder run:

7z.exe l h5pTEST.h5p

Using zip on Linux/Unix and Apple Mac OS

Run command below in terminal with switches.

zip -r -D -X nameof_h5p_file.h5p *

to verify run:

zipinfo nameof_h5p_file.h5p