feat(openapi3): batch-convert long-tail RequiredFieldError sites#1170
Merged
fenollp merged 2 commits intoMay 9, 2026
Merged
Conversation
Follow-up to getkin#1166 covering 7 long-tail untyped errors that fit the existing RequiredFieldError cluster shape: - externalDocs.url - operation.responses - requestBody.content - response.description - oAuthFlow.scopes - oAuthFlow.authorizationUrl - oAuthFlow.tokenUrl Each gets a leaf type, a constructor populating Origin from the relevant element, and a converted call site. operation_test.go switches from require.Equal-against-errors.New() to require.EqualError on the message string. Two representative tests pin cluster + leaf + base reachability.
d8669b6 to
600079d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Seven long-tail untyped errors converted to the
*RequiredFieldErrorcluster pattern.external_docs.go:66*ExternalDocsURLRequiredexternalDocs.urloperation.go:212*OperationResponsesRequiredoperation.responsesrequest_body.go:126*RequestBodyContentRequiredrequestBody.contentresponse.go:182*ResponseDescriptionRequiredresponse.descriptionsecurity_scheme.go:389*OAuthFlowScopesRequiredoAuthFlow.scopessecurity_scheme.go:405*OAuthFlowAuthorizationURLRequiredoAuthFlow.authorizationUrlsecurity_scheme.go:418*OAuthFlowTokenURLRequiredoAuthFlow.tokenUrlExisting tests with
require.Equal(t, errors.New("..."))against the converted sites switched torequire.EqualErroron the message string (one site:operation_test.go'sTestOperationValidation).Two new tests in
validation_error_test.gopin the cluster + leaf + base reachability for representative cases (operation.responses,externalDocs.url); the other five follow the same mechanical shape.Backward compat
Every converted site preserves its original
Error()string byte-for-byte.Scope
Only sites that fit the existing
RequiredFieldErrorcluster — no new cluster types. Other long-tail flavors (mutually-exclusive fields, "should not be set", link XOR-required, etc.) need new clusters and would land in separate follow-ups.