Skip to content

Validate empty Swagger property names#2343

Open
king-407 wants to merge 1 commit into
swagger-api:masterfrom
king-407:issue-2339-empty-property-name-validation
Open

Validate empty Swagger property names#2343
king-407 wants to merge 1 commit into
swagger-api:masterfrom
king-407:issue-2339-empty-property-name-validation

Conversation

@king-407

@king-407 king-407 commented Jun 9, 2026

Copy link
Copy Markdown

Fixes #2339.

What changed

This adds validation for Swagger 2.0 schemas that contain an empty property name under properties.

Previously, a schema like this was parsed without reporting a validation message:

"properties": {
  "AA": { "type": "string" },
  "": { "type": "number" }
}

The converter now adds a validation message for the empty property name while continuing to parse the document.

Testing

Ran the focused regression test and the full V2ConverterTest class:

mvn -pl modules/swagger-parser-v2-converter -am -Dtest=V2ConverterTest#testEmptyPropertyNameHasMessage -Dsurefire.failIfNoSpecifiedTests=false test
mvn -pl modules/swagger-parser-v2-converter -am -Dtest=V2ConverterTest -Dsurefire.failIfNoSpecifiedTests=false test

Signed-off-by: king-407 <95581750+king-407@users.noreply.github.com>
@king-407 king-407 marked this pull request as ready for review June 9, 2026 15:41
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.

[Bug]: Anonymous objects fail to report errors during parsing

1 participant