Skip to content

feat(openapi3): ForbiddenFieldError cluster for set-but-not-allowed fields#1172

Closed
reuvenharrison wants to merge 1 commit into
getkin:masterfrom
oasdiff:feat/validation-error-forbidden-fields
Closed

feat(openapi3): ForbiddenFieldError cluster for set-but-not-allowed fields#1172
reuvenharrison wants to merge 1 commit into
getkin:masterfrom
oasdiff:feat/validation-error-forbidden-fields

Conversation

@reuvenharrison

Copy link
Copy Markdown
Contributor

Adds a ForbiddenFieldError cluster covering four sites where the spec forbids a field in a specific context.

Site Leaf Field
header.go:57 *HeaderNameForbidden name
header.go:60 *HeaderInForbidden in
security_scheme.go:407 *OAuthFlowAuthorizationURLForbidden authorizationUrl
security_scheme.go:420 *OAuthFlowTokenURLForbidden tokenUrl

Backward compat

Every converted site preserves its original Error() string byte-for-byte.

Tests

TestValidationError_ForbiddenFieldLeaves covers the two header sites end-to-end. The two OAuth flow sites fire through the same constructor pattern and are exercised indirectly through document round-trip validation.

…ields

Converts four 'field MUST NOT be set in this context' sites:
- header.name (given by the headers map key)
- header.in (implicitly 'header')
- OAuth flow authorizationUrl (wrong flow type)
- OAuth flow tokenUrl (wrong flow type)
@reuvenharrison

Copy link
Copy Markdown
Contributor Author

Superseded by #1180 — combined per @fenollp's request on #1177 to avoid rebase churn. The original commit on this branch is preserved unchanged in #1180.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant