code wiki / (root) / nx_bindings_openapi_capture_gate.nx

nx_bindings_openapi_capture_gate.nx source

↩ module page · 14 lines · 1003 B

1import "nx_bindings_delivery_gate.nx" 2func main(argc: i64, argv: *i64) -> i64 { 3 if argc != 4 { gv_puts("usage: gate <old-hub> <staged-hub> </tmp/unique-basename>\n" as *u8); return 3 } 4 let prefix: *u8 = argv[3] as *u8 5 if bd_prefix(prefix) == 0 { return 3 } 6 if ep_anchor() < 0 { return 3 } 7 let ctr: *i64 = gv_ctr() 8 let oldpath: *u8 = bd_path(prefix, ".old-openapi.json" as *u8) 9 let newpath: *u8 = bd_path(prefix, ".new-openapi.json" as *u8) 10 gv_check("old-exclusive-capture-exit-zero" as *u8, bd_capture(argv[1] as *u8, "openapi" as *u8, 0 as *u8, 0 as *u8, oldpath) == 0, ctr) 11 gv_check("new-exclusive-capture-exit-zero" as *u8, bd_capture(argv[2] as *u8, "openapi" as *u8, 0 as *u8, 0 as *u8, newpath) == 0, ctr) 12 gv_puts("old=" as *u8); gv_puts(oldpath); gv_puts("\nnew=" as *u8); gv_puts(newpath); gv_puts("\n" as *u8) 13 return gv_verdict("OPENAPI-CAPTURE" as *u8, ctr, "full JSON parse and additive semantic equality still required before promotion" as *u8) 14}