DowngradeYAML converts this OpenAPI 3.1 spec to OpenAPI 3.0.3, returning the YAML []byte representation of the downgraded spec.
()
| 1695 | // DowngradeYAML converts this OpenAPI 3.1 spec to OpenAPI 3.0.3, returning the |
| 1696 | // YAML []byte representation of the downgraded spec. |
| 1697 | func (o *OpenAPI) DowngradeYAML() ([]byte, error) { |
| 1698 | specJSON, err := o.Downgrade() |
| 1699 | buf := bytes.NewBuffer([]byte{}) |
| 1700 | if err == nil { |
| 1701 | err = yaml.Convert(buf, bytes.NewReader(specJSON)) |
| 1702 | } |
| 1703 | return buf.Bytes(), err |
| 1704 | } |