From 4df63a83c93ba0f591eb78110e184bfef0f76535 Mon Sep 17 00:00:00 2001 From: Dan Duvall Date: Wed, 19 Sep 2018 11:06:46 -0700 Subject: Provide OpenAPI spec for Blubberoid Wrote an OpenAPI 3.0 spec for Blubberoid that provides `x-amples` entries compatible with service-checker. The written spec includes basic schema for Blubber config objects that may be later factored out for use in validation. Note that OpenAPI 3.0 supports only the v4 draft of the JSON Schema standard, so some parts of the configuration could not be fully described. Specifically, v4 does not include the `patternProperties` definition introduced in the JSON Schema v6 draft that would allow us to describe `variants` and `runs.environment` and everything beneath. Blubberoid was refactored slightly to incorporate the new spec as well as assume JSON as the canonical and default configuration format. It was also refactored to include a versioned namespace ("v1") after the server endpoint. Bug: T205920 Change-Id: I28a341aa503b8920d802715660d4c4d62be45475 --- scripts/generate-const.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 scripts/generate-const.sh (limited to 'scripts') diff --git a/scripts/generate-const.sh b/scripts/generate-const.sh new file mode 100755 index 0000000..f049389 --- /dev/null +++ b/scripts/generate-const.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# +# Generates a Go const from the contents of a static file, and appends it at +# the line following the go:generate directive that calls this script. +# +set -euo pipefail + +sed -i.sed.bak -e "$((GOLINE+1)),\$d" "$GOFILE" +rm "$GOFILE.sed.bak" + +(echo -n "const $1 = \`"; cat "$2"; echo "\`") >> "$GOFILE" -- cgit v1.2.1