openservicebrokerapi / osb-checker

An automatic checker to verify an Open Service Broker API implementation against the specification
https://github.com/openservicebrokerapi/servicebroker/
Apache License 2.0
48 stars 40 forks source link

Deprecated parameters for provisioning #82

Open mrgunior opened 4 years ago

mrgunior commented 4 years ago

Branch: dev File: provision.go

This test case for organization_guid:

Convey("should reject if request payload is missing organization_guid", func() {
    tempBody := openapi.ServiceInstanceProvisionRequest{}
    deepCopy(req, &tempBody)
    tempBody.OrganizationGuid = ""
    _, resp, err := cli.ServiceInstancesApi.ServiceInstanceProvision(
        authCtx, CONF.APIVersion, instanceID, tempBody,
        &openapi.ServiceInstanceProvisionOpts{AcceptsIncomplete: optional.NewBool(async)})

    So(err, ShouldNotBeNil)
    So(resp.StatusCode, ShouldEqual, 400)
})

And this one for space_guid:
Convey("should reject if request payload is missing space_guid", func() {
    tempBody := openapi.ServiceInstanceProvisionRequest{}
    deepCopy(req, &tempBody)
    tempBody.SpaceGuid = ""
    _, resp, err := cli.ServiceInstancesApi.ServiceInstanceProvision(
        authCtx, CONF.APIVersion, instanceID, tempBody,
        &openapi.ServiceInstanceProvisionOpts{AcceptsIncomplete: optional.NewBool(async)})

    So(err, ShouldNotBeNil)
    So(resp.StatusCode, ShouldEqual, 400)
})

These two parameters have been replaced with the parameter context (which is optional) in version 2.11 of the OSBAPI. Are they still necessary according to the current specifications?

leonwanghui commented 4 years ago

@mrgunior If you look at the spec, currently the organization_guid and space_guid fields are still required for request to provision an instance, I believe it's designed to be back-compatible with former version.