Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation Data Node OpenAPI specification with IBM OpenAPI Validator #72

Closed
tschaffter opened this issue Nov 6, 2020 · 4 comments · Fixed by #71
Closed

Validation Data Node OpenAPI specification with IBM OpenAPI Validator #72

tschaffter opened this issue Nov 6, 2020 · 4 comments · Fixed by #71
Assignees
Labels
Locked Closed by the Lock workflow

Comments

@tschaffter
Copy link
Member

The openapi validates the data node API, however the python-flask server created from it throws the following error:

connexion.exceptions.InvalidSpecification: Required list has not defined properties: ['noteId']

I could not find the issue from a quick look at the spec, so I googled and found this comment.

Turns out the swagger.yaml file had a lot of errors which did not show up in a lot of the validators.
https://github.com/IBM/openapi-validator shows them correctly to be fixed.

This is the second time I come across IBM OpenAPI Validator, so I decide to give it a try in #71

@tschaffter tschaffter self-assigned this Nov 6, 2020
@tschaffter
Copy link
Member Author

Here is the current list of errors and warnings for the Data Node API:

$ ./node_modules/.bin/lint-openapi dist.yaml

errors

  Message :   Parameter names must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/annotationStore.post.parameters.0
  Line    :   167

  Message :   Parameter names must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/annotationStore.get.parameters.0
  Line    :   196

  Message :   Parameter names must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/annotationStore/{id}.get.parameters.0
  Line    :   244

  Message :   Parameter names must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/annotationStore/{id}.delete.parameters.0
  Line    :   274

  Message :   Parameter names must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/annotationStore/{storeId}/annotations.post.parameters.0
  Line    :   305

  Message :   Parameter names must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/annotationStore/{storeId}/annotations.post.parameters.1
  Line    :   311

  Message :   Parameter names must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/annotationStore/{storeId}/annotations.get.parameters.0
  Line    :   344

  Message :   Parameter names must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/annotationStore/{storeId}/annotations.get.parameters.1
  Line    :   350

  Message :   Parameter names must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/annotationStore/{storeId}/annotations/{id}.get.parameters.0
  Line    :   400

  Message :   Parameter names must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/annotationStore/{storeId}/annotations/{id}.get.parameters.1
  Line    :   406

  Message :   Parameter names must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/annotationStore/{storeId}/annotations/{id}.delete.parameters.0
  Line    :   438

  Message :   Parameter names must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/annotationStore/{storeId}/annotations/{id}.delete.parameters.1
  Line    :   444

  Message :   Parameter names must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/noteStore.post.parameters.0
  Line    :   477

  Message :   Parameter names must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/noteStore.get.parameters.0
  Line    :   506

  Message :   Parameter names must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/noteStore/{id}.get.parameters.0
  Line    :   554

  Message :   Parameter names must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/noteStore/{id}.delete.parameters.0
  Line    :   584

  Message :   Parameter names must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/noteStore/{storeId}/notes.post.parameters.0
  Line    :   615

  Message :   Parameter names must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/noteStore/{storeId}/notes.post.parameters.1
  Line    :   621

  Message :   Parameter names must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/noteStore/{storeId}/notes.get.parameters.0
  Line    :   650

  Message :   Parameter names must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/noteStore/{storeId}/notes.get.parameters.1
  Line    :   656

  Message :   Parameter names must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/noteStore/{storeId}/notes/{id}.get.parameters.0
  Line    :   704

  Message :   Parameter names must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/noteStore/{storeId}/notes/{id}.get.parameters.1
  Line    :   710

  Message :   Parameter names must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/noteStore/{storeId}/notes/{id}.delete.parameters.0
  Line    :   740

  Message :   Parameter names must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/noteStore/{storeId}/notes/{id}.delete.parameters.1
  Line    :   746

  Message :   Path segments must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/annotationStore
  Line    :   159

  Message :   Path segments must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/annotationStore/{id}
  Line    :   236

  Message :   Path segments must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/annotationStore/{storeId}/annotations
  Line    :   297

  Message :   Path segments must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/annotationStore/{storeId}/annotations/{id}
  Line    :   392

  Message :   Path segments must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/noteStore
  Line    :   469

  Message :   Path segments must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/noteStore/{id}
  Line    :   546

  Message :   Path segments must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/noteStore/{storeId}/notes
  Line    :   607

  Message :   Path segments must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/noteStore/{storeId}/notes/{id}
  Line    :   696

  Message :   Schema of type string should use one of the following formats: byte, binary, date, date-time, password.
  Path    :   components.schemas.PageResponse.properties.links.properties.next.type
  Line    :   817

  Message :   Property names must follow case convention: lower_snake_case
  Path    :   components.schemas.AnnotationStore.properties.datasetId
  Line    :   861

  Message :   Property names must follow case convention: lower_snake_case
  Path    :   components.schemas.StoredAnnotation.allOf.1.properties.noteId
  Line    :   887

  Message :   Property names must follow case convention: lower_snake_case
  Path    :   components.schemas.StoredDateAnnotation.allOf.1.properties.noteId
  Line    :   909

  Message :   Property names must follow case convention: lower_snake_case
  Path    :   components.schemas.NoteStore.properties.datasetId
  Line    :   925

  Message :   Property names must follow case convention: lower_snake_case
  Path    :   components.schemas.Service.properties.authorEmail
  Line    :   1002

  Message :   Schema of type string should use one of the following formats: byte, binary, date, date-time, password.
  Path    :   components.schemas.Service.properties.authorEmail.type
  Line    :   1004

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

warnings

  Message :   The limit parameter must be of type integer and optional with default and maximum values.
  Path    :   paths./datasets.get.parameters.0
  Line    :   76

  Message :   A paginated list operation must include a "limit" property in the response body schema.
  Path    :   paths./datasets.get.responses.200.content.application/json.schema.properties
  Line    :   98

  Message :   A paginated list operation with an "offset" parameter must include an "offset" property in the response body schema.
  Path    :   paths./datasets.get.responses.200.content.application/json.schema.properties
  Line    :   98

  Message :   A paginated list operation must include an array property whose name matches the final segment of the path.
  Path    :   paths./datasets.get.responses.200.content.application/json.schema.properties
  Line    :   98

  Message :   The limit parameter must be of type integer and optional with default and maximum values.
  Path    :   paths./datasets/{datasetId}/annotationStore.get.parameters.1
  Line    :   202

  Message :   A paginated list operation must include a "limit" property in the response body schema.
  Path    :   paths./datasets/{datasetId}/annotationStore.get.responses.200.content.application/json.schema.properties
  Line    :   224

  Message :   A paginated list operation with an "offset" parameter must include an "offset" property in the response body schema.
  Path    :   paths./datasets/{datasetId}/annotationStore.get.responses.200.content.application/json.schema.properties
  Line    :   224

  Message :   A paginated list operation must include an array property whose name matches the final segment of the path.
  Path    :   paths./datasets/{datasetId}/annotationStore.get.responses.200.content.application/json.schema.properties
  Line    :   224

  Message :   The limit parameter must be of type integer and optional with default and maximum values.
  Path    :   paths./datasets/{datasetId}/annotationStore/{storeId}/annotations.get.parameters.2
  Line    :   356

  Message :   A paginated list operation must include a "limit" property in the response body schema.
  Path    :   paths./datasets/{datasetId}/annotationStore/{storeId}/annotations.get.responses.200.content.application/json.schema.properties
  Line    :   378

  Message :   A paginated list operation with an "offset" parameter must include an "offset" property in the response body schema.
  Path    :   paths./datasets/{datasetId}/annotationStore/{storeId}/annotations.get.responses.200.content.application/json.schema.properties
  Line    :   378

  Message :   A paginated list operation must include an array property whose name matches the final segment of the path.
  Path    :   paths./datasets/{datasetId}/annotationStore/{storeId}/annotations.get.responses.200.content.application/json.schema.properties
  Line    :   378

  Message :   The limit parameter must be of type integer and optional with default and maximum values.
  Path    :   paths./datasets/{datasetId}/noteStore.get.parameters.1
  Line    :   512

  Message :   A paginated list operation must include a "limit" property in the response body schema.
  Path    :   paths./datasets/{datasetId}/noteStore.get.responses.200.content.application/json.schema.properties
  Line    :   534

  Message :   A paginated list operation with an "offset" parameter must include an "offset" property in the response body schema.
  Path    :   paths./datasets/{datasetId}/noteStore.get.responses.200.content.application/json.schema.properties
  Line    :   534

  Message :   A paginated list operation must include an array property whose name matches the final segment of the path.
  Path    :   paths./datasets/{datasetId}/noteStore.get.responses.200.content.application/json.schema.properties
  Line    :   534

  Message :   The limit parameter must be of type integer and optional with default and maximum values.
  Path    :   paths./datasets/{datasetId}/noteStore/{storeId}/notes.get.parameters.2
  Line    :   662

  Message :   A paginated list operation must include a "limit" property in the response body schema.
  Path    :   paths./datasets/{datasetId}/noteStore/{storeId}/notes.get.responses.200.content.application/json.schema.properties
  Line    :   684

  Message :   A paginated list operation with an "offset" parameter must include an "offset" property in the response body schema.
  Path    :   paths./datasets/{datasetId}/noteStore/{storeId}/notes.get.responses.200.content.application/json.schema.properties
  Line    :   684

  Message :   A paginated list operation must include an array property whose name matches the final segment of the path.
  Path    :   paths./datasets/{datasetId}/noteStore/{storeId}/notes.get.responses.200.content.application/json.schema.properties
  Line    :   684

  Message :   operationIds should follow naming convention: operationId verb should be add or create
  Path    :   paths./datasets.post.operationId
  Line    :   52

  Message :   operationIds should follow naming convention: operationId verb should be list
  Path    :   paths./datasets.get.operationId
  Line    :   74

  Message :   operationIds should follow naming convention: operationId verb should be get
  Path    :   paths./datasets/{id}.get.operationId
  Line    :   116

  Message :   operationIds should follow naming convention: operationId verb should be delete
  Path    :   paths./datasets/{id}.delete.operationId
  Line    :   140

  Message :   operationIds should follow naming convention: operationId verb should be add or create
  Path    :   paths./datasets/{datasetId}/annotationStore.post.operationId
  Line    :   165

  Message :   operationIds should follow naming convention: operationId verb should be list
  Path    :   paths./datasets/{datasetId}/annotationStore.get.operationId
  Line    :   194

  Message :   operationIds should follow naming convention: operationId verb should be get
  Path    :   paths./datasets/{datasetId}/annotationStore/{id}.get.operationId
  Line    :   242

  Message :   operationIds should follow naming convention: operationId verb should be delete
  Path    :   paths./datasets/{datasetId}/annotationStore/{id}.delete.operationId
  Line    :   272

  Message :   operationIds should follow naming convention: operationId verb should be add or create
  Path    :   paths./datasets/{datasetId}/annotationStore/{storeId}/annotations.post.operationId
  Line    :   303

  Message :   operationIds should follow naming convention: operationId verb should be list
  Path    :   paths./datasets/{datasetId}/annotationStore/{storeId}/annotations.get.operationId
  Line    :   342

  Message :   operationIds should follow naming convention: operationId verb should be get
  Path    :   paths./datasets/{datasetId}/annotationStore/{storeId}/annotations/{id}.get.operationId
  Line    :   398

  Message :   operationIds should follow naming convention: operationId verb should be delete
  Path    :   paths./datasets/{datasetId}/annotationStore/{storeId}/annotations/{id}.delete.operationId
  Line    :   436

  Message :   operationIds should follow naming convention: operationId verb should be add or create
  Path    :   paths./datasets/{datasetId}/noteStore.post.operationId
  Line    :   475

  Message :   operationIds should follow naming convention: operationId verb should be list
  Path    :   paths./datasets/{datasetId}/noteStore.get.operationId
  Line    :   504

  Message :   operationIds should follow naming convention: operationId verb should be get
  Path    :   paths./datasets/{datasetId}/noteStore/{id}.get.operationId
  Line    :   552

  Message :   operationIds should follow naming convention: operationId verb should be delete
  Path    :   paths./datasets/{datasetId}/noteStore/{id}.delete.operationId
  Line    :   582

  Message :   operationIds should follow naming convention: operationId verb should be add or create
  Path    :   paths./datasets/{datasetId}/noteStore/{storeId}/notes.post.operationId
  Line    :   613

  Message :   operationIds should follow naming convention: operationId verb should be list
  Path    :   paths./datasets/{datasetId}/noteStore/{storeId}/notes.get.operationId
  Line    :   648

  Message :   operationIds should follow naming convention: operationId verb should be get
  Path    :   paths./datasets/{datasetId}/noteStore/{storeId}/notes/{id}.get.operationId
  Line    :   702

  Message :   operationIds should follow naming convention: operationId verb should be delete
  Path    :   paths./datasets/{datasetId}/noteStore/{storeId}/notes/{id}.delete.operationId
  Line    :   738

  Message :   operationIds must follow case convention: lower_snake_case
  Path    :   paths./datasets.get.operationId
  Line    :   74

  Message :   operationIds must follow case convention: lower_snake_case
  Path    :   paths./datasets.post.operationId
  Line    :   52

  Message :   operationIds must follow case convention: lower_snake_case
  Path    :   paths./datasets/{id}.get.operationId
  Line    :   116

  Message :   operationIds must follow case convention: lower_snake_case
  Path    :   paths./datasets/{id}.delete.operationId
  Line    :   140

  Message :   operationIds must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/annotationStore.get.operationId
  Line    :   194

  Message :   operationIds must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/annotationStore.post.operationId
  Line    :   165

  Message :   operationIds must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/annotationStore/{id}.get.operationId
  Line    :   242

  Message :   operationIds must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/annotationStore/{id}.delete.operationId
  Line    :   272

  Message :   operationIds must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/annotationStore/{storeId}/annotations.get.operationId
  Line    :   342

  Message :   operationIds must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/annotationStore/{storeId}/annotations.post.operationId
  Line    :   303

  Message :   operationIds must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/annotationStore/{storeId}/annotations/{id}.get.operationId
  Line    :   398

  Message :   operationIds must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/annotationStore/{storeId}/annotations/{id}.delete.operationId
  Line    :   436

  Message :   operationIds must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/noteStore.get.operationId
  Line    :   504

  Message :   operationIds must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/noteStore.post.operationId
  Line    :   475

  Message :   operationIds must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/noteStore/{id}.get.operationId
  Line    :   552

  Message :   operationIds must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/noteStore/{id}.delete.operationId
  Line    :   582

  Message :   operationIds must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/noteStore/{storeId}/notes.get.operationId
  Line    :   648

  Message :   operationIds must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/noteStore/{storeId}/notes.post.operationId
  Line    :   613

  Message :   operationIds must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/noteStore/{storeId}/notes/{id}.get.operationId
  Line    :   702

  Message :   operationIds must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/noteStore/{storeId}/notes/{id}.delete.operationId
  Line    :   738

  Message :   Common path parameters should be defined on path object
  Path    :   paths./datasets/{datasetId}/annotationStore.post.parameters.0
  Line    :   167

  Message :   Common path parameters should be defined on path object
  Path    :   paths./datasets/{datasetId}/annotationStore.get.parameters.0
  Line    :   196

  Message :   Common path parameters should be defined on path object
  Path    :   paths./datasets/{datasetId}/annotationStore/{id}.get.parameters.0
  Line    :   244

  Message :   Common path parameters should be defined on path object
  Path    :   paths./datasets/{datasetId}/annotationStore/{id}.delete.parameters.0
  Line    :   274

  Message :   Common path parameters should be defined on path object
  Path    :   paths./datasets/{datasetId}/annotationStore/{storeId}/annotations.post.parameters.0
  Line    :   305

  Message :   Common path parameters should be defined on path object
  Path    :   paths./datasets/{datasetId}/annotationStore/{storeId}/annotations.get.parameters.0
  Line    :   344

  Message :   Common path parameters should be defined on path object
  Path    :   paths./datasets/{datasetId}/annotationStore/{storeId}/annotations.post.parameters.1
  Line    :   311

  Message :   Common path parameters should be defined on path object
  Path    :   paths./datasets/{datasetId}/annotationStore/{storeId}/annotations.get.parameters.1
  Line    :   350

  Message :   Common path parameters should be defined on path object
  Path    :   paths./datasets/{datasetId}/annotationStore/{storeId}/annotations/{id}.get.parameters.0
  Line    :   400

  Message :   Common path parameters should be defined on path object
  Path    :   paths./datasets/{datasetId}/annotationStore/{storeId}/annotations/{id}.delete.parameters.0
  Line    :   438

  Message :   Common path parameters should be defined on path object
  Path    :   paths./datasets/{datasetId}/annotationStore/{storeId}/annotations/{id}.get.parameters.1
  Line    :   406

  Message :   Common path parameters should be defined on path object
  Path    :   paths./datasets/{datasetId}/annotationStore/{storeId}/annotations/{id}.delete.parameters.1
  Line    :   444

  Message :   Common path parameters should be defined on path object
  Path    :   paths./datasets/{datasetId}/noteStore.post.parameters.0
  Line    :   477

  Message :   Common path parameters should be defined on path object
  Path    :   paths./datasets/{datasetId}/noteStore.get.parameters.0
  Line    :   506

  Message :   Common path parameters should be defined on path object
  Path    :   paths./datasets/{datasetId}/noteStore/{id}.get.parameters.0
  Line    :   554

  Message :   Common path parameters should be defined on path object
  Path    :   paths./datasets/{datasetId}/noteStore/{id}.delete.parameters.0
  Line    :   584

  Message :   Common path parameters should be defined on path object
  Path    :   paths./datasets/{datasetId}/noteStore/{storeId}/notes.post.parameters.0
  Line    :   615

  Message :   Common path parameters should be defined on path object
  Path    :   paths./datasets/{datasetId}/noteStore/{storeId}/notes.get.parameters.0
  Line    :   650

  Message :   Common path parameters should be defined on path object
  Path    :   paths./datasets/{datasetId}/noteStore/{storeId}/notes.post.parameters.1
  Line    :   621

  Message :   Common path parameters should be defined on path object
  Path    :   paths./datasets/{datasetId}/noteStore/{storeId}/notes.get.parameters.1
  Line    :   656

  Message :   Common path parameters should be defined on path object
  Path    :   paths./datasets/{datasetId}/noteStore/{storeId}/notes/{id}.get.parameters.0
  Line    :   704

  Message :   Common path parameters should be defined on path object
  Path    :   paths./datasets/{datasetId}/noteStore/{storeId}/notes/{id}.delete.parameters.0
  Line    :   740

  Message :   Common path parameters should be defined on path object
  Path    :   paths./datasets/{datasetId}/noteStore/{storeId}/notes/{id}.get.parameters.1
  Line    :   710

  Message :   Common path parameters should be defined on path object
  Path    :   paths./datasets/{datasetId}/noteStore/{storeId}/notes/{id}.delete.parameters.1
  Line    :   746

  Message :   Schema must have a non-empty description.
  Path    :   components.schemas.Error
  Line    :   830

  Message :   Schema must have a non-empty description.
  Path    :   components.schemas.Health
  Line    :   958

  Message :   Property has inconsistent type: status.
  Path    :   components.schemas.Error.properties.status
  Line    :   836

  Message :   Property has inconsistent type: status.
  Path    :   components.schemas.Health.properties.status
  Line    :   961

@tschaffter
Copy link
Member Author

tschaffter commented Nov 6, 2020

Here are the steps taken to resolve the above errors and warning.

Errors

  Message :   Parameter names must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/annotationStore.post.parameters.0
  Line    :   167

Resolution: Changed settings to "lower_camel_case"

  Message :   Path segments must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/annotationStore
  Line    :   159

Resolution: Changed settings to "lower_camel_case"

  Message :   Schema of type string should use one of the following formats: byte, binary, date, date-time, password.
  Path    :   components.schemas.PageResponse.properties.links.properties.next.type
  Line    :   817

Resolution: "uri" is indeed not an official format but is suggested in openapi docs. The format is mentioned as an "open" list, so ideally the IBM Validator should allow me to specify the type of format that I deed valid. This feature is being mentioned here. I prefer to keep the "uri" format as it enriches the specification, including the HTML page rendered. I'm configuring this type of errors to be reported as warnings.

Message :   Property names must follow case convention: lower_snake_case
  Path    :   components.schemas.AnnotationStore.properties.datasetId
  Line    :   861

Resolution: Changed settings to "lower_camel_case"

Warnings

  Message :   Property has inconsistent type: status.
  Path    :   components.schemas.Error.properties.status
  Line    :   837

  Message :   Property has inconsistent type: status.
  Path    :   components.schemas.Health.properties.status
  Line    :   963

Comment: Error.properties.status and Health.properties.status have nothing to do with each other aside that the property share the same name ("status'). The status code for the Error must be a number (ref).

Resolution: Setting the option to off.

  Message :   Common path parameters should be defined on path object
  Path    :   paths./datasets/{datasetId}/annotationStore.post.parameters.0
  Line    :   167

Resolution: Followed the recommendations.

  Message :   operationIds must follow case convention: lower_snake_case
  Path    :   paths./datasets/{datasetId}/noteStore/{storeId}/notes/{id}.delete.operationId
  Line    :   658

Resolution: Followed the recommendations after setting the format to "lower_camel_case".

  Message :   A paginated list operation must include an array property whose name matches the final segment of the path.
  Path    :   paths./datasets/{datasetId}/noteStore/{storeId}/notes.get.responses.200.content.application/json.schema.properties
  Line    :   604

Resolution: Following this recommendation would lead to duplication of information (the "final segment of the path" and the "name of the array"). It's also easier if the user knows that the items returned in a page are in an array always named the same way.

  Message :   Response schemas should be defined with a named ref.
  Path    :   paths./datasets.get.responses.200.content.application/json.schema.allOf.1
  Line    :   101

Resolution: Followed the recommendations after changing the settings to error as shown below:

    "responses": {
      "inline_response_schema": "error"
    },

Results

Here are the remaining warnings that are accepted:

$ ./node_modules/.bin/lint-openapi dist.yaml

warnings

  Message :   Schema of type string should use one of the following formats: byte, binary, date, date-time, password.
  Path    :   components.schemas.PageResponse.properties.links.properties.next.type
  Line    :   692

  Message :   Schema of type string should use one of the following formats: byte, binary, date, date-time, password.
  Path    :   components.schemas.Service.properties.authorEmail.type
  Line    :   947

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

@tschaffter
Copy link
Member Author

Done

@tschaffter tschaffter changed the title Validation OpenAPI specification with IBM OpenAPI Validator Validation Data Node OpenAPI specification with IBM OpenAPI Validator Nov 7, 2020
@github-actions
Copy link

github-actions bot commented Nov 8, 2021

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.

@github-actions github-actions bot added the Locked Closed by the Lock workflow label Nov 8, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Locked Closed by the Lock workflow
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant