Skip to content

docs(openapi): pin VersionInfo.viVersion length to match the validator (#308)#309

Merged
CryptoJones merged 1 commit into
masterfrom
docs/openapi-versioninfo-version-length
May 19, 2026
Merged

docs(openapi): pin VersionInfo.viVersion length to match the validator (#308)#309
CryptoJones merged 1 commit into
masterfrom
docs/openapi-versioninfo-version-length

Conversation

@CryptoJones
Copy link
Copy Markdown
Owner

Closes #308.

Summary

versioninfo.schema.js caps viVersion at 1..255 chars. The OpenAPI component schema left it unbounded. Adds minLength: 1, maxLength: 255 and pins it with a test.

Test plan

  • npm run lint && npm test — 773 passing (was 772).

Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/

versioninfo.schema.js caps `viVersion` at 1..255 chars, but the
OpenAPI component schema declared it as a bare `{ type: 'string' }`.
SDK generators reading the spec couldn't see the bound, so client-
side validation had no way to catch oversized payloads before they
round-trip.

SemVer is much shorter than 255 in practice, but the cap matches
every other free-text "name/identifier" column in the API for
consistency.

Add `minLength: 1, maxLength: 255` to the component schema and pin
the bound with a test in tests/api/openapi.test.js.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@CryptoJones CryptoJones merged commit 6a36263 into master May 19, 2026
3 checks passed
@CryptoJones CryptoJones deleted the docs/openapi-versioninfo-version-length branch May 19, 2026 17:16
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.

OpenAPI: VersionInfo.viVersion is unbounded but zod caps at 255

1 participant