Sage-Bionetworks / rocc-schemas

OpenAPI specification of the Registry of Open Community Challenges
Apache License 2.0
0 stars 0 forks source link

Fix new validation warning from ibm-openapi-validator 1.0.0-beta.44 #89

Closed tschaffter closed 3 years ago

tschaffter commented 3 years ago

IBM OpenAPI validator shows a bunch of new warning when using its latest release.

Solution

All the new warnings are removed after creating a file .spectral.yaml with custom spectral rules, which is a complementary way to configure the validator in addition to the config file .validaterc. According to the validator doc, some rules can only be changed in .spectral.yaml. This is also the place where we could place one day our own custom rules for the R&BT projects.

The warnings are now back to:

$ npm run validate

> validate
> npm run build && lint-openapi --config .validaterc --ruleset .spectral.yaml -v openapi.yaml

> build
> openapi bundle -o openapi openapi/openapi.yaml

bundling openapi/openapi.yaml...
📦 Created a bundle for openapi/openapi.yaml at openapi.yaml 73ms.

warnings

  Message :   Schema of type string should use one of the following formats: byte, binary, date, date-time, password.
  Rule    :   invalid_type_format_pair
  Path    :   components.schemas.ResponsePageMetadata.properties.paging.properties.next.type
  Line    :   889

  Message :   Schema of type string should use one of the following formats: byte, binary, date, date-time, password.
  Rule    :   invalid_type_format_pair
  Path    :   components.schemas.ChallengeCreateRequest.properties.url.type
  Line    :   957

  Message :   Schema of type string should use one of the following formats: byte, binary, date, date-time, password.
  Rule    :   invalid_type_format_pair
  Path    :   components.schemas.GrantCreateRequest.properties.url.type
  Line    :   1059

  Message :   Schema of type string should use one of the following formats: byte, binary, date, date-time, password.
  Rule    :   invalid_type_format_pair
  Path    :   components.schemas.OrganizationCreateRequest.properties.url.type
  Line    :   1112

  Message :   Schema of type string should use one of the following formats: byte, binary, date, date-time, password.
  Rule    :   invalid_type_format_pair
  Path    :   components.schemas.Email.type
  Line    :   1165
tschaffter commented 3 years ago

The remaining warnings lead be to this ticket.

Unfortunately the ticket got closed without providing the requested solution. One approach is to disable invalid_type_format_pair but we may loose valuable information about the "suggested" standard. Keeping the warning for now.

github-actions[bot] commented 2 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.