Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchiTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
OPA’s documentation says a leading v makes a SemVer string invalid, yet the same page shows semver.is_valid("v1.1.12-rc1+foo") returning true. The SemVer 2.0.0 specification says v1.2.3 is not a semantic version. That is a documentation conflict—not proof of how any particular OPA release evaluates the input.
What does OPA document?
OPA describes semver.is_valid(vsn) as a built-in that accepts vsn (any) and returns a boolean: true for a valid semantic version and false otherwise. The reference describes the version format as MAJOR.MINOR.PATCH[-PRERELEASE][+METADATA], with the bracketed parts optional. It lists the built-in as available beginning with OPA v0.22.0 and notes that WebAssembly support is SDK-dependent. OPA’s Semantic Version Built-ins reference
The conflict is within that reference. Its warning says: “When working with Go-style semantic versions, remember to remove the leading v character, or the semver string will be marked as invalid!” But its example output marks both semver.is_valid("v1.1.12-rc1+foo") and semver.is_valid("1.1.12-rc1+foo") as true. The warning and the displayed result do not straightforwardly agree about the same input.
Recommended Free Tools
Why does SemVer reject a leading v?
In SemVer 2.0.0, a version has three numeric core components—major, minor, and patch—written as X.Y.Z. Prerelease identifiers can follow a hyphen, and build metadata can follow a plus sign. The specification also disallows leading zeroes in those numeric components.
#1 Best Overall
Its FAQ answers the prefix question directly: “No, ‘v1.2.3’ is not a semantic version.” A leading v is often used in a tag name or as notation indicating a version, but it is not part of the SemVer string itself. Under the specification, 1.2.3 is the semantic version. Semantic Versioning 2.0.0
Does a specific OPA release accept v1.2.3?
The documentation conflict alone does not establish runtime behavior for a particular OPA release or evaluator. Keep two questions separate: whether the input conforms to SemVer 2.0.0, and what a particular OPA build does when semver.is_valid receives it. The specification answers the first; the contradictory example does not settle the second.
OPA’s Operations documentation shows the built-in used as a policy predicate, for example semver.is_valid(input.version). It also explains that capabilities files can be used to check built-in compatibility for policies. Those compatibility details address whether a policy can use a built-in in a given environment; they do not resolve whether a leading-v input is accepted by a specific evaluator. OPA Operations
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Quick Recap
Best Value
Rank #4
Rank #3
How should you handle a leading-v value?
- Define the input contract. Decide whether the field must contain a SemVer string or may contain a tag or other version notation. If the contract requires SemVer 2.0.0, a leading
vis outside that format. - Check the actual environment. Confirm the OPA release and evaluator in use, then verify the result there rather than treating the documentation example as conclusive for every release.
- Normalize only when appropriate. If your input contract treats a leading-
vtag as a representation of a SemVer version, remove the prefix before validation. Do not silently normalize if the prefix has meaning in your application or if the contract requires the original value to be preserved. - Check built-in compatibility separately. Use the capabilities information for the target environment to confirm policy compatibility; that check is distinct from testing the input format.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

