openservicebrokerapi / servicebroker

Open Service Broker API Specification
https://openservicebrokerapi.org/
Apache License 2.0
1.19k stars 436 forks source link

Some errors when validating openapi.yaml #662

Closed leonwanghui closed 5 years ago

leonwanghui commented 5 years ago

What is the problem? Recently I found an openapi validation tool from OpenAPITools code repo, and when I try to validate the openapi.yaml, some errors are reported below:

root@ubuntu:~# docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli validate -i /local/openapi.yaml
Validating spec (/local/openapi.yaml)
Errors:
    -attribute paths.'/v2/service_instances/{instance_id}/last_operation'(get).responses.200.headers is not of type `object`
    -attribute components.parameters.RetryAfter.[Retry-After].require is unexpected
    -attribute paths.'/v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation'(get).responses.200.headers is not of type `object`

[error] Spec has 3 errors.

Who does this affect? None

Do you have any proposed solutions? Fix all errors reported above.

Additional context Add any other context or screenshots can go here.

blgm commented 5 years ago

When working on #666, we saw errors validating the Swagger too:

Validating spec (/local/swagger.yaml)
Errors:
    -attribute paths.'/v2/service_instances/{instance_id}'. Declared path parameter instance_id needs to be defined as a path parameter in path or operation level
    -attribute paths.'/v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation'. Declared path parameter instance_id needs to be defined as a path parameter in path or operation level
    -attribute paths.'/v2/service_instances/{instance_id}/service_bindings/{binding_id}'. Declared path parameter binding_id needs to be defined as a path parameter in path or operation level
    -attribute paths.'/v2/service_instances/{instance_id}/last_operation'. Declared path parameter instance_id needs to be defined as a path parameter in path or operation level
    -attribute paths.'/v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation'. Declared path parameter binding_id needs to be defined as a path parameter in path or operation level
    -attribute paths.'/v2/service_instances/{instance_id}/service_bindings/{binding_id}'. Declared path parameter instance_id needs to be defined as a path parameter in path or operation level
[error] Spec has 6 errors.

https://travis-ci.org/openservicebrokerapi/servicebroker/builds/532910734?utm_source=github_status&utm_medium=notification

leonwanghui commented 5 years ago

@blgm I noticed that, but when I use go-swagger tool to validate swagger.yaml and it shows no errors, which is odd.

blgm commented 5 years ago

I guess the validation tools have slight implementation differences.

It would be a step forward to validating using a tool in the CI. If we find that we prefer other tools, or want to validate using more than one tool, we can do that in the future.