Skip to content

fix(api): correct YAML indentation in API specs - #4656

Open
JorisHeadease wants to merge 1 commit into
masterfrom
fix/openapi-spec-yaml
Open

JorisHeadease wants to merge 1 commit into
masterfrom
fix/openapi-spec-yaml

Conversation

@JorisHeadease

Copy link
Copy Markdown
Contributor

Three specs are not valid YAML 1.2.2: a closing flow bracket sits at the same indentation as its key, while §8.2.3 requires flow nodes to be indented more than their parent block collection. Many parsers are lenient here; the YAML test matrix for 9C9N "Wrong indented flow sequence" shows several accepting an invalid case. js-yaml 5 reports it:

for f in $(git ls-files 'docs/_static/*.yaml'); do npx -y js-yaml@5 "$f" >/dev/null 2>&1 || echo "$f"; done

On master this prints auth/v1.yaml, auth/v2.yaml and common/ssi_types.yaml; on this branch it prints nothing. The generated Go code is unchanged.

Three specs close a flow sequence at the same indentation as its key.
YAML 1.2.2 section 8.2.3 requires flow nodes to be indented by at
least one more space than the parent block collection, so these files
are not valid YAML. Indent the closing brackets one level further.

See https://yaml.org/spec/1.2.2/#823-block-nodes

The generated Go code is unchanged.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant