Skip to content

feat(openapi3): RequiredFieldError leaves for doc-root info/paths/jsonSchemaDialect#1176

Closed
reuvenharrison wants to merge 1 commit into
getkin:masterfrom
oasdiff:feat/validation-error-doc-root-required
Closed

feat(openapi3): RequiredFieldError leaves for doc-root info/paths/jsonSchemaDialect#1176
reuvenharrison wants to merge 1 commit into
getkin:masterfrom
oasdiff:feat/validation-error-doc-root-required

Conversation

@reuvenharrison

Copy link
Copy Markdown
Contributor

Three new RequiredFieldError leaves for doc-root validation in T.Validate.

Site Leaf Field
openapi3.go:297 *InfoRequired info
openapi3.go:306 *PathsRequired paths
openapi3.go:355 *JSONSchemaDialectAbsoluteURIRequired jsonSchemaDialect

All three live on the document root *T, which the loader doesn't track an Origin for; the constructors pass nil for Origin, matching the pattern already used by OpenAPIVersionRequired, WebhooksFieldFor31Plus, and JSONSchemaDialectFieldFor31Plus.

Backward compat

Every converted site preserves its original Error() string byte-for-byte (including the surrounding invalid info: ... / invalid paths: ... / invalid jsonSchemaDialect: ... wrap from T.Validate).

Tests

TestValidationError_DocRootRequiredLeaves covers all three sites end-to-end.

… jsonSchemaDialect URI

Three new RequiredFieldError leaves at the doc-validation root:
- info (must be an object)
- paths (must be an object — 3.0 only)
- jsonSchemaDialect (must be an absolute URI with a scheme)
@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