Skip to content

test: add tests for non-dict JSON validation in JsonSchema - #104

Open
Shreyas-Gowda26 wants to merge 2 commits into
deyna256:mainfrom
Shreyas-Gowda26:main
Open

test: add tests for non-dict JSON validation in JsonSchema#104
Shreyas-Gowda26 wants to merge 2 commits into
deyna256:mainfrom
Shreyas-Gowda26:main

Conversation

@Shreyas-Gowda26

Copy link
Copy Markdown

Closes #54

Added tests covering the untested branch in JsonSchema.validate()
where valid JSON is not a dict:

  • test_array_returns_false: "[1, 2, 3]" returns False with error
  • test_number_returns_false: "42" returns False with error
  • test_invalid_json_returns_false: invalid JSON returns False with error
  • test_valid_dict: valid JSON dict passes correctly
  • test_missing_required_keys: missing keys returns False

All 84 tests pass with coverage requirements met.

@deyna256

deyna256 commented Mar 14, 2026

Copy link
Copy Markdown
Owner

@Shreyas-Gowda26 hi, ur solution has style issues...

@Shreyas-Gowda26

Copy link
Copy Markdown
Author

@deyna256 Hi! Fixed the ruff style issues. CI should pass now!

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.

Reserved-field conflict in generate() tested only for 'messages'

2 participants