Skip to content

fix: honor required fields in JSON schemas - #834

Draft
yaodong-shen wants to merge 1 commit into
HumanSignal:masterfrom
yaodong-shen:fix-json-schema-required-fields
Draft

fix: honor required fields in JSON schemas#834
yaodong-shen wants to merge 1 commit into
HumanSignal:masterfrom
yaodong-shen:fix-json-schema-required-fields

Conversation

@yaodong-shen

Copy link
Copy Markdown

Summary

  • honor each object schema's required array when creating Pydantic fields
  • use declared defaults (or an omittable None default) for non-required properties without making explicit null valid
  • preserve the existing contract that all skill response fields are required
  • cover top-level and nested required semantics with regression tests

Fixes #833.

Validation

  • black --check adala/utils/pydantic_generator.py tests/test_pydantic_generator.py
  • python -m py_compile adala/utils/pydantic_generator.py tests/test_pydantic_generator.py
  • pytest -q tests/test_pydantic_generator.py tests/test_skills.py tests/test_label_studio_skill.py tests/test_analysis_skill.py (22 passed, 3 skipped)
  • full pytest: 78 passed, 4 skipped, 9 deselected; one unrelated Gemini image VCR test fails because the response lacks content after its image fetch path. The same failure reproduces on clean origin/master.

@yaodong-shen

Copy link
Copy Markdown
Author

The Check, pytests, Docs, and CI/CD Pipeline workflows are waiting for maintainer approval and created no jobs for this external-fork PR. The focused and full local test suites pass apart from the documented unrelated Gemini baseline failure. Could a maintainer approve the workflow runs when convenient?

@robot-ci-heartex
robot-ci-heartex marked this pull request as draft July 27, 2026 16:44
@yaodong-shen
yaodong-shen marked this pull request as ready for review July 28, 2026 03:33
@robot-ci-heartex
robot-ci-heartex marked this pull request as draft July 28, 2026 13:35
@yaodong-shen
yaodong-shen marked this pull request as ready for review July 28, 2026 19:34
@robot-ci-heartex
robot-ci-heartex marked this pull request as draft July 29, 2026 07:00
@yaodong-shen
yaodong-shen marked this pull request as ready for review July 29, 2026 11:31
@robot-ci-heartex
robot-ci-heartex marked this pull request as draft July 29, 2026 22:21
@yaodong-shen
yaodong-shen marked this pull request as ready for review July 30, 2026 19:46
@robot-ci-heartex
robot-ci-heartex marked this pull request as draft July 31, 2026 07:05
@yaodong-shen
yaodong-shen marked this pull request as ready for review July 31, 2026 11:51
@robot-ci-heartex
robot-ci-heartex marked this pull request as draft July 31, 2026 22:23
@yaodong-shen
yaodong-shen marked this pull request as ready for review August 1, 2026 03:46
@robot-ci-heartex
robot-ci-heartex marked this pull request as draft August 1, 2026 14:32
@yaodong-shen
yaodong-shen marked this pull request as ready for review August 1, 2026 19:48
@robot-ci-heartex
robot-ci-heartex marked this pull request as draft August 2, 2026 06:58
@yaodong-shen
yaodong-shen marked this pull request as ready for review August 2, 2026 11:50
@robot-ci-heartex
robot-ci-heartex marked this pull request as draft August 2, 2026 22:20
@yaodong-shen
yaodong-shen marked this pull request as ready for review August 3, 2026 03:46
@robot-ci-heartex
robot-ci-heartex marked this pull request as draft August 3, 2026 15:06
@yaodong-shen
yaodong-shen marked this pull request as ready for review August 3, 2026 20:24
@robot-ci-heartex
robot-ci-heartex marked this pull request as draft August 4, 2026 06:58
@yaodong-shen
yaodong-shen marked this pull request as ready for review August 4, 2026 11:57
@robot-ci-heartex
robot-ci-heartex marked this pull request as draft August 4, 2026 22:26
@yaodong-shen
yaodong-shen marked this pull request as ready for review August 5, 2026 07:46
@robot-ci-heartex
robot-ci-heartex marked this pull request as draft August 5, 2026 18:35
@yaodong-shen
yaodong-shen marked this pull request as ready for review August 5, 2026 23:46
@robot-ci-heartex
robot-ci-heartex marked this pull request as draft August 6, 2026 10:53
@yaodong-shen
yaodong-shen marked this pull request as ready for review August 6, 2026 15:47
@robot-ci-heartex
robot-ci-heartex marked this pull request as draft August 7, 2026 01:49
@yaodong-shen
yaodong-shen marked this pull request as ready for review August 7, 2026 07:49
@robot-ci-heartex
robot-ci-heartex marked this pull request as draft August 7, 2026 18:19
@yaodong-shen
yaodong-shen marked this pull request as ready for review August 7, 2026 23:50
@robot-ci-heartex
robot-ci-heartex marked this pull request as draft August 8, 2026 10:10
@yaodong-shen
yaodong-shen marked this pull request as ready for review August 8, 2026 15:51
@robot-ci-heartex
robot-ci-heartex marked this pull request as draft August 9, 2026 02:45
@yaodong-shen
yaodong-shen marked this pull request as ready for review August 10, 2026 00:04
@robot-ci-heartex
robot-ci-heartex marked this pull request as draft August 10, 2026 10:30
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.

JSON Schema converter treats optional properties as required

1 participant