Skip to content

Comments

Ignore readOnly/writeOnly set to False#248

Merged
p1c2u merged 1 commit intomasterfrom
fix/readOnly-writeOnly-boolean-semantics-fix
Feb 20, 2026
Merged

Ignore readOnly/writeOnly set to False#248
p1c2u merged 1 commit intomasterfrom
fix/readOnly-writeOnly-boolean-semantics-fix

Conversation

@p1c2u
Copy link
Collaborator

@p1c2u p1c2u commented Feb 20, 2026

This pull request improves the handling of readOnly and writeOnly properties in the OpenAPI schema validator. It ensures that properties explicitly set to False for these keywords are correctly ignored during validation, and adds tests to verify this behavior.

Validation logic improvements:

  • Updated the write_readOnly function in openapi_schema_validator/_keywords.py to immediately return if the readOnly flag is not set, preventing unnecessary validation errors when readOnly is False.
  • Updated the read_writeOnly function in openapi_schema_validator/_keywords.py to immediately return if the writeOnly flag is not set, preventing unnecessary validation errors when writeOnly is False.

Testing enhancements:

  • Added test_read_only_false and test_write_only_false to tests/integration/test_validators.py to ensure that properties with readOnly: False or writeOnly: False are validated without errors.

@p1c2u p1c2u merged commit a195558 into master Feb 20, 2026
14 checks passed
@p1c2u p1c2u changed the title readOnly/writeOnly boolean semantics Ignore readOnly/writeOnly set to False Feb 20, 2026
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