Skip to content

OAS 3 validation fails with confusing name error message #994

@ronfogel

Description

@ronfogel

Description

I attached a simple OAS 3 file that should pass validation.
However, while debugging, I noticed that the validation fails due to missing required fields that are only relevant to the API Key security scheme.

The problem is that the spec I provided defines an OAuth2 security scheme, and everything appears to be valid.

To verify, I tested the spec in Swagger Editor (next) and confirmed it is valid according to the official OAS 3 specification.

This makes me suspect the issue may be related either to Ajv or to something specific in your package’s handling of security schemes.

Expected Behavior

The OAS 3 file should pass validation without errors.

Actual Behavior

Validation fails with incorrect errors about required fields for the wrong security scheme.

Environment

  • oas-normalize: 15.0.1
  • node: 22.17.0

Additional Context

  • Confirmed the spec is valid in Swagger Editor.
  • Validated against official OAS 3 spec.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions