openservicebrokerapi / servicebroker

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

Mismatch in the response of last operation for service bindings in openapi.yaml #738

Open anoopjb opened 3 years ago

anoopjb commented 3 years ago

What is the problem? We have a mismatch in the response of last operation for service bindings in openapi.yaml from OSBApi specification v2.16. The openapi.yaml reuses the LastOperationResource schema from the service instance. So the swagger shows response of GET request to ​/v2​/service_instances​/{instance_id}​/service_bindings​/{binding_id}​/last_operation as,

{
  "state": "in progress",
  "description": "string",
  "instance_usable": true,
  "update_repeatable": true
}

But the v2.16 specification advises having the response as,

{
  "state": "in progress",
  "description": "Creating binding (10% complete)."
}

The instance_usable and update_repeatable fields don't help binding anyway.

Who does this affect? This might lead to a bit of confusion. Maybe the swagger-generated brokers might deviate from spec.

Do you have any proposed solutions? An easy solution is to have a new ServiceBindingLastOperationResource schema.

    ServiceBindingLastOperationResource:
      type: object
      required:
        - state
      properties:
        state:
          type: string
          enum:
            - in progress
            - succeeded
            - failed
        description:
          type: string

Additional context None