Files
moby/api/scripts/validate-swagger.sh
T
Florian Stellbrink fdf1048c91 ci(swagger): validate yaml with spec compliant tool
yamllint does not report invalid indentation.

libfyaml passes the yaml test suite and catches these issues.

not replacing yamllint to preserve existing style rules.

Signed-off-by: Florian Stellbrink <flo@stellbr.ink>
2026-09-30 20:48:14 +02:00

18 lines
356 B
Bash
Executable File

#!/usr/bin/env bash
set -e
# Expected to be in api directory
cd "$(dirname "${BASH_SOURCE[0]}")/.."
echo "Validating swagger.yaml..."
fy-tool --yaml-1.2 --null-output swagger.yaml
yamllint -f parsable -c validate/yamllint.yaml swagger.yaml
if out=$(swagger validate swagger.yaml); then
echo "Validation done! ${out}"
else
echo "${out}" >&2
false
fi