Snipget.ai

Semver validate

Exact
semver_validate

Deterministic and authoritative — the canonical answer for this input.

Lightweight SemVer format validator: returns is_valid + canonical form without a full component breakdown. Use semver_parse when you need major/minor/patch pieces. Processing multiple inputs? Use `semver_validate_batch` to do up to 1000 in one call.

Parameters

versionstringrequired

SemVer 2.0.0 string (leading 'v' tolerated).

Call it

curl -X POST https://api.snipget.ai/v1/semver/validate \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"version":"v1.0.0"}'

The Batch tab sends up to 1000 inputs in one call via /v1/semver/validate/batch.

Example response

{
  "input": "v1.0.0",
  "is_valid": true,
  "canonical": "1.0.0"
}

FAQ

What does this check?

It tells you whether a string is a properly formatted semantic version, a clean yes or no, and gives you the tidied-up canonical form. "v1.0.0" is valid and its canonical form is "1.0.0" with the leading v removed.

How is this different from the parse tool?

Validate is the lightweight gate: it returns just is_valid plus the canonical string. Parse goes further and hands back every component (major, minor, patch, pre-release, build). Use validate when you only need a pass/fail check, and parse when you need the pieces.

Can I rely on the verdict?

Yes. Validation is exact and deterministic against the SemVer 2.0.0 specification, so the result is the authoritative answer and never changes for the same input.

What counts as invalid?

Anything that does not match the SemVer 2.0.0 format. A common one is leaving off a number, like "1.2", which is rejected because all three of major, minor, and patch are required. A leading "v" is allowed and stripped in the canonical output.

What do I get back when a version is invalid?

Not an error. You get is_valid false with confidence 0 and a why_invalid reason explaining what was wrong, so you can show the user a helpful message.

Related tools