sshfp
SSQ
stacksize
+stampfile
starttransaction
Stasic
statbag
#!/usr/bin/env python3
-import yaml
import argparse
-
-from typing import Dict, Any, overload, cast
from collections.abc import Mapping
+from pathlib import Path
+from typing import Any, Dict, cast, overload
-# This function was taken (and slightly modified) from https://github.com/instrumenta/openapi2jsonschema
+import yaml
+# This function was taken (and slightly modified) from https://github.com/instrumenta/openapi2jsonschema
# overload function signatures for different input types
@overload
def change_dict_values(
ap = argparse.ArgumentParser()
ap.add_argument("infile", type=str)
ap.add_argument("outfile", type=str)
+ ap.add_argument("--stampfile", type=str)
args = ap.parse_args()
data: dict | None = None
with open(args.outfile, "w") as w:
yaml.safe_dump(out, w)
+ if args.stampfile:
+ Path.touch(args.stampfile)
+
if __name__ == "__main__":
main()
endif
if python.found()
+ json_schema = custom_target(
+ 'auth-json-schema',
+ input: product_source_dir / docs_dir / 'http-api' / 'swagger' / 'authoritative-api-swagger.yaml',
+ output: 'auth-schema-generated.stamp',
+ command: [
+ python,
+ product_source_dir / docs_dir / 'generate-jsonschema.py',
+ '@INPUT@',
+ product_source_dir / docs_dir / 'http-api' / 'swagger' / 'authoritative-api-schema.yaml',
+ '--stampfile',
+ '@OUTPUT@'
+ ],
+ )
+
html_docs = custom_target(
'html-docs',
command: [
output: 'sphinx.stamp',
console: true,
depfile: 'sphinx.d',
+ depends: [json_schema],
)
docs_tarball = custom_target(
output: 'PowerDNS-Authoritative.pdf',
console: true,
depfile: 'sphinx.d',
+ depends: [json_schema],
)
run_target(
)
if python.found()
+ json_schema = custom_target(
+ 'recursor-json-schema',
+ input: product_source_dir / docs_dir / 'http-api' / 'authoritative-api-swagger.yaml',
+ output: 'rec-schema-generated.stamp',
+ command: [
+ python,
+ product_source_dir / docs_dir / 'generate-jsonschema.py',
+ '@INPUT@',
+ product_source_dir / docs_dir / 'http-api' / 'recursor-generated-schema.yaml',
+ '--stampfile',
+ '@OUTPUT@'
+ ],
+ )
html_docs = custom_target(
'html-docs',
output: 'sphinx.stamp',
console: true,
depfile: 'sphinx.d',
- depends: [ metricfiles, recrust ], # for generated .rst files
+ depends: [ metricfiles, recrust, json_schema ], # for generated .rst files
)
docs_tarball = custom_target(