Repository navigation
v1.69.0
🎯 Spec Conformance: Stricter Where the Spec Is Strict, Looser Where It Always Allowed
validate rejected valid documents and accepted invalid ones. This release fixes six reported cases of that, makes the result order stable, and reports custom OAS 3.2 methods at the path the document spells them. Across the ten real-world specifications in our corpus, 372 errors become 2, and the two left are GitHub's own published description repeating a templated path under two names.
✅ Documents that failed now pass
requirednames need not be declared locally (#631). A name may come from anallOfsibling,additionalProperties,patternPropertiesor another composition, so it is no longer checked againstproperties.- Nullable enums and wide integers (#633).
nullis accepted in an enum markednullable: true(3.0) orx-nullable: true(2.0), and integers past the int64 range are accepted in YAML and JSON. - An empty server variable default (#630).
default: ""is valid, and aServerVariablebuilt in Go withDefault: ""now validates too. - More email addresses (#629).
contact.emailfollows the RFC 5321 Mailbox rule: quoted local parts and address literals are accepted. An IPv4 literal with a leading zero is deliberately refused. - Response references and 3.2 security URIs (#634). A response written as a
$refmay carrysummary, a$refalias undercomponents.responsesneeds nodescription, and from 3.2 a security requirement name may be the URI of a Security Scheme Object.
⚠️ Documents that passed can now fail
- Duplicate parameters (#638). A parameter list may not repeat a name and location, with a
$reffollowed to the parameter it names. An operation parameter that overrides a path item one is still allowed. - Equivalent templated paths (#638).
/pets/{id}and/pets/{name}describe the same URLs and may not both exist. GitHub's published OpenAPI description has two such pairs. - A non-string server variable default (#630). A bare number or boolean is reported with its path. JSON used to fail the whole parse on it.
- Security requirement names everywhere (#634). A name that matches no declared scheme is now reported inside callbacks, webhooks and component path items, not only under
paths. - A few email addresses the old pattern accepted by mistake: leading or doubled dots, and a hyphen at the edge of a label.
- An escaped hash at the start of a reference (
%23/...) is no longer read as a local pointer. It is a relative file reference, as RFC 3986 says.
⚖️ Now warnings, not errors
These are valid JSON Schema that no instance can satisfy, which is worth pointing out and not a reason to fail a document (#633). Redocly, Spectral and vacuum report the first at most as a warning and the second not at all.
- an enum member that no instance can match (the wrong type, or NaN or infinity in a number enum)
minimumabovemaximum, andminLengthabovemaxLength
They disappear when warnings are off, and the Google Maps specification now validates, with a warning for each mismatched member.
📋 Results you can rely on
- Errors and warnings are sorted by path, then message (#632, fixes #425). One honest exception: the text of a duplicate
operationIdmessage can still name a different "first" operation from run to run (#639). - Custom OAS 3.2 methods are reported where the document spells them (#635, fixes #573):
paths./items.additionalOperations.PURGE, notpaths./items.PURGE. That path now leads somewhere, so--source-mapfinds a line for it. The validator, the parser's structure check, the fixer and the generator all agree. A problem in a webhook found by the parser is reported underwebhooks.hook.post, notpaths.webhooks.hook.post. - JSON output keeps
x-extensions on server variables (it used to drop them) and leaves out adefaultthe document never had.
🧰 New API
// The segment that names an operation of a path item. A custom 3.2 method
// comes back as "additionalOperations.PURGE", a standard one as its name.
for method, op := range parser.GetOperations(pathItem, doc.OASVersion) {
if op == nil {
continue
}
fmt.Println(parser.OperationPathSegment(pathItem, method, op))
}
// A server variable's default is REQUIRED, and "" is a valid one.
if !variable.HasDefault() {
// the document wrote no default, or wrote one that is not a string
}parser.OperationPathSegment is the one owner of how an operation's path is spelled. ServerVariable.DefaultAbsent and HasDefault() tell a missing default from an empty one.
📊 What it costs
ValidateParsed allocates a little more for the new checks: 66 to 77 on the smallest benchmark document, +7% on the medium one and +3% on the large one. Parse, fix and join are unchanged.
🔒 User Impact
- Why a minor release: new exported API (
parser.OperationPathSegment,ServerVariable.DefaultAbsentandHasDefault()), and validation that is stricter in the ways listed above. - Stricter: duplicate parameters, equivalent templated paths, a non-string server variable default, and unknown security requirement names outside
pathsnow fail a document that passed before. - No breaking API removals.
- Not changed yet, so do not rely on it: header names that differ only in case (
X-Traceandx-trace) are still compared exactly, although the specification says they are the same header (#637). Related conformance gaps are tracked in #636, #640, #641, #642 and #643.
📊 Quality Metrics
- ✅ All tests passing (11,995 tests)
- ✅ Zero vulnerabilities (
govulncheckclean) - ✅ CI benchmarks ran for the release
- ✅ Documentation verified against real
validateoutput
What's Changed
Other Changes
- docs: rename the contributing guide and record the security lessons by @erraggy in #626
- chore: add benchmark results for v1.68.0 by @erraggy in #627
- fix(validator): accept an empty string as a server variable default by @erraggy in #630
- fix(stringutil): validate email addresses against the RFC 5321 Mailbox rule by @erraggy in #629
- fix(validator): stop requiring a required name to be declared in properties by @erraggy in #631
- fix(validator): order the result so the same document gives the same output by @erraggy in #632
- fix(validator): accept nullable enums and wide integers, warn on enum mismatch and contradictory bounds by @erraggy in #633
- fix(validator): accept response references and 3.2 security URIs, check security names everywhere by @erraggy in #634
- fix: report custom 3.2 methods where the document spells them by @erraggy in #635
- fix(validator): reject duplicate parameters and equivalent templated paths by @erraggy in #638
- chore: prepare v1.69.0 release by @erraggy in #644
Full Changelog: v1.68.0...v1.69.0
Full Changelog: v1.68.0...v1.69.0