We have hit one case where overlay functionality gets completely broken due to unserialize-serialize-deserialize of YAML files and apparently is caused by a bug in underlying yaml library (go-yaml/yaml#1071).
This API spec works fine if not using overlay functionality:
openapi: 3.0.1
info: {}
paths:
/info:
get:
parameters:
- description: |2-
a
b
name: filter
schema:
type: string
in: query
responses: {}
However, once overlay is added, tool fails with an error:
error loading swagger spec in spec.yaml
: failed to parse spec from "spec.yaml": yaml: line 8: did not find expected key
It seems like it's because LoadSwaggerWithOverlay re-marshals the spec into this:
info:
title: ""
version: ""
openapi: 3.0.1
paths:
/info:
get:
parameters:
- description: |4-
a
b
in: query
name: filter
schema:
type: string
responses: {}
.. which is no longer a valid YAML.
This seems to be specific to parameter list though; if adding description to "get" directly, this bug does not appear.
We have hit one case where overlay functionality gets completely broken due to unserialize-serialize-deserialize of YAML files and apparently is caused by a bug in underlying yaml library (go-yaml/yaml#1071).
This API spec works fine if not using overlay functionality:
However, once overlay is added, tool fails with an error:
It seems like it's because
LoadSwaggerWithOverlayre-marshals the spec into this:.. which is no longer a valid YAML.
This seems to be specific to parameter list though; if adding description to "get" directly, this bug does not appear.