Project

General

Profile

« Previous | Next » 

Revision 57ce414c

Added by koszko over 1 year ago

validate repository responses against JSON schemas

  • compute_scripts.awk (include_file): don't enforce specific path format on #INCLUDE'd files
  • .gitmodules, schemas: add Haketilo JSON schemas subrepo
  • html/install.js (InstallView): import schema validator and run it against downloaded mapping and resource definitions
  • html/repo_query.js (RepoEntry): import schema validator and run it against obtained query results
  • test/haketilo_test/unit/test_install.py (test_install_normal_usage, test_install_dialogs): use underscore instead of hyphen in item identifiers
  • test/haketilo_test/unit/test_install.py (test_install_dialogs): adapt error message test cases to new handling method of invalid JSON instanced
  • test/haketilo_test/unit/test_repo_query.py (test_repo_query_normal_usage): use underscore instead of hyphen in item identifiers
  • test/haketilo_test/unit/test_repo_query.py (test_repo_query_messages): use higher sample unsupported schema version to avoid having to modify the test case soon
  • test/haketilo_test/world_wide_library.py: use underscore instead of hyphen in item identifiers
  • common/jsonschema.js, common/jsonschema: adapt tdegrunt's jsonschema and include in Haketilo, load schema documents from schemas/

View differences:

compute_scripts.awk
370 370

  
371 371
function include_file(root_path, read_path, included_path, line, verbatim,
372 372
		      read_line, result) {
373
    if (validate_path(read_path, included_path, line))
374
	return 1
375

  
376 373
    if (included_path in reading) {
377 374
	printf "ERROR: Inclusion loop when including %s in %s\n",
378 375
	    included_path, read_path > "/dev/stderr"

Also available in: Unified diff