Page MenuHomePhabricator

Fix or disable oas3-valid-media-example date validation
Closed, ResolvedPublic

Description

Discovered while working on T419576

Linting the OAD example currently raises date format errors due to validation in the built-in oas3-valid-media-example rule. This behavior is similar to the problem described under oas3-valid-schema-example (line 621 and others) in T414974:

The linter converts dates in YAML to date-time under the hood. If the field that got converted is a date, then the linter reports an error. It's a common behavior (Swagger Editor does that too), but it seems incorrect. You can test this by comparing the schema for startDate and endDate parameters in the YAML input with the same parameters in Linter Results after running the linter.

Investigate whether this validation is working correctly and if we can fix it in the same way as in T414974 - by disabling the rule - or if we need a different solution.

Details

Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
oas3-valid-media-example: Disable rule due to false positive errors generated for valid datesrepos/ci-tools/wikimedia-spectral-ruleset!1milazgfeat/T425952main
Customize query in GitLab

Event Timeline

milazg opened https://gitlab.wikimedia.org/repos/ci-tools/wikimedia-spectral-ruleset/-/merge_requests/1

oas3-valid-media-example: Disable rule due to false positive errors generated for valid dates

aghirelli merged https://gitlab.wikimedia.org/repos/ci-tools/wikimedia-spectral-ruleset/-/merge_requests/1

oas3-valid-media-example: Disable rule due to false positive errors generated for valid dates