Skip to content

fix(cli): pluralize validate-schema counts like list-schemas does - #85

Open
Thorsrud22 wants to merge 1 commit into
pranjalparmar:mainfrom
Thorsrud22:fix/validate-schema-pluralization
Open

Thorsrud22 wants to merge 1 commit into
pranjalparmar:mainfrom
Thorsrud22:fix/validate-schema-pluralization

Conversation

@Thorsrud22

Copy link
Copy Markdown

What this does

Fixes #82.

validate-schema printed the literal field(s) / example(s) regardless of count. list_schemas() in the same file already does real singular/plural handling, so this applies the same approach to validate_schema() for both counts:

Schema 'Invoice' is valid: 9 fields, 1 example.
Schema 'One' is valid: 1 field, 1 example.

Tests: the existing test_validate_schema_valid_bundled assertion now checks for the real plural (and that field(s) is gone), and a new test_validate_schema_singular_counts covers the 1 field, 1 example case. Changelog entry added under Unreleased / Fixed.

Checklist

  • Added or updated tests for anything behavioral this changes
  • Ran the full suite locally (pytest -v), not just the file touched — 97 passed on Python 3.12
  • Updated docs/ and/or README.md if a CLI flag, Schema/Field option, or output shape changed — no docs quote this message, so only CHANGELOG.md changed
  • Kept the PR scoped to one thing (see CONTRIBUTING.md if unsure)

🤖 Generated with Claude Code

validate-schema printed the literal "field(s)" and "example(s)"
regardless of count. list-schemas already uses real singular/plural
logic in the same file; apply the same approach here so the summary
reads "1 field" or "9 fields, 1 example".

Update the existing assertion and add a test for the singular case.

Fixes pranjalparmar#82

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.

validate-schema's field-count message doesn't pluralize correctly

1 participant