Skip to content

Commit

Permalink
Fix GeoLocation.Longitude validation (#30)
Browse files Browse the repository at this point in the history
Co-authored-by: Jacob Lundberg <[email protected]>
  • Loading branch information
jacoblu and jacoblu authored Dec 20, 2024
1 parent a9665b7 commit c8946f5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static bool ValidLatitude(string? value) =>
// OCPI has an error in documentation. It says the max length for Longitude is 11 but their regex says it is 12.
public static IRuleBuilderOptions<TClass, string?> ValidLongitude<TClass>(this IRuleBuilder<TClass, string?> ruleBuilder) =>
ruleBuilder
.Must(ValidLatitude)
.Must(ValidLongitude)
.WithMessage($"'{{PropertyName}}' is not a valid longitude value. Must match Regex : {_longitudeRegexValue}")
.MaximumLength(12);

Expand Down

0 comments on commit c8946f5

Please sign in to comment.