Fixes issue 57: Empty object schemas were incorrectly flagged as incomplete#37
Merged
prasanthcisco merged 1 commit intomainfrom Feb 18, 2026
Merged
Conversation
esyriac
approved these changes
Feb 13, 2026
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.
Issue:
Empty object schemas were incorrectly flagged as incomplete when they had
type: "object", noproperties, andadditionalProperties: false.Rule affected:
general-schema-definition(Contract Completeness / Doc Completeness)Fix:
Treat object schemas with
additionalProperties: falseas complete, since they explicitly define an empty object contract{}.Problem
Schemas like the following were reported with "properties missing for object schema":
{ "type": "object", "example": {}, "description": "Response for a successful association/disassociation of connections to a policy", "additionalProperties": false }This is a valid OpenAPI/JSON Schema:
additionalProperties: falsemeans no extra properties are allowed, so the only valid value is{}. Such schemas are commonly used for success acknowledgments, DELETE responses, and bulk-update responses.Solution
updates to
functions/completedSchema.jsAllow empty objects when
additionalProperties: falseBefore returning the error, the function now returns early (no error) when
targetVal.additionalProperties === false.Null-safe guard
Added a check for
targetVal == nullso thatnulland other non-object inputs do not cause runtime errors and are treated as “skip” (returnundefined).Tests
additionalProperties: false(with/without description, example, and v1AddOrUpdatePolicyConnectionsResponse-style); object withproperties: {}andadditionalProperties: false.type: "object"with noadditionalProperties: false;additionalProperties: true;additionalPropertiesas a schema object.null) pass (returnundefined).general-schema-definition“should pass with provided schema” runs againstpositive.json, which now includes the/ackpath with an empty-object schema.