danielgtaylor / danielgtaylor/huma

bug: DowngradeYAML / OpenAPI 3.0.3 incorrectly produces `description` siblings for `$ref`

Open
#1,001 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
4.4k
Forks
285
Avg merge
40m
Merged PRs (30d)
1

Description

I'm running `vacuum` linter against specs produced by Huma and caught an issue with the default ruleset. See similar example from:
https://github.com/OAI/OpenAPI-Specification/issues/1514

```yaml
location:
description: User home address location <- error
$ref: "#/components/schemas/Location"
carLocation:
description: Where user has left his car <- error
$ref: "#/components/schemas/Location"
```

When calling `DowngradeYAML` to get an OAS 3.0.3 spec from Huma, invalid YAML like the above is produced with the `description` field set. The behavior has changed in OpenAPI 3.1.0 to allow `description` -- but it's not allowed in 3.0.3

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.