From 7ae31eb91643a39c2d5dafde66604bae31a9e9d2 Mon Sep 17 00:00:00 2001 From: Sam Gunaratne Date: Wed, 20 Aug 2025 13:26:36 -0600 Subject: [PATCH] Improve service instance type matching --- apis/cf/latest/components/schemas/Job.yaml | 6 +++--- .../schemas/ServiceCredentialBindingList.yaml | 5 +++++ .../components/schemas/ServiceInstanceList.yaml | 5 +++++ .../schemas/UserProvidedServiceInstance.yaml | 5 ++--- .../latest/paths/ServiceCredentialBindings.yaml | 15 +++++++++++++++ apis/cf/latest/paths/ServiceInstances.yaml | 10 ++++++++++ 6 files changed, 40 insertions(+), 6 deletions(-) diff --git a/apis/cf/latest/components/schemas/Job.yaml b/apis/cf/latest/components/schemas/Job.yaml index 4a36b41..d7fb196 100644 --- a/apis/cf/latest/components/schemas/Job.yaml +++ b/apis/cf/latest/components/schemas/Job.yaml @@ -33,16 +33,16 @@ allOf: manifest: $ref: './Link.yaml' description: The URL to get the manifest for this job - service_broker: + service_brokers: $ref: './Link.yaml' description: The URL to get the service broker for this job service_credential_binding: $ref: './Link.yaml' description: The URL to get the service credential binding for this job - service_instance: + service_instances: $ref: './Link.yaml' description: The URL to get the service instance for this job - service_route_binding: + service_route_bindings: $ref: './Link.yaml' description: The URL to get the service route binding for this job description: 'Jobs are created by the platform when performing certain asynchronous actions. Asynchronous jobs are commonly used for long-running tasks such as uploading large files, staging applications, or deleting resources.' diff --git a/apis/cf/latest/components/schemas/ServiceCredentialBindingList.yaml b/apis/cf/latest/components/schemas/ServiceCredentialBindingList.yaml index 6753bbb..8b22723 100644 --- a/apis/cf/latest/components/schemas/ServiceCredentialBindingList.yaml +++ b/apis/cf/latest/components/schemas/ServiceCredentialBindingList.yaml @@ -8,3 +8,8 @@ properties: oneOf: - $ref: './AppCredentialBinding.yaml' - $ref: './KeyCredentialBinding.yaml' + discriminator: + propertyName: type + mapping: + app: './AppCredentialBinding.yaml' + key: './KeyCredentialBinding.yaml' diff --git a/apis/cf/latest/components/schemas/ServiceInstanceList.yaml b/apis/cf/latest/components/schemas/ServiceInstanceList.yaml index a1fff70..e1e9966 100644 --- a/apis/cf/latest/components/schemas/ServiceInstanceList.yaml +++ b/apis/cf/latest/components/schemas/ServiceInstanceList.yaml @@ -8,3 +8,8 @@ properties: oneOf: - $ref: './ManagedServiceInstance.yaml' - $ref: './UserProvidedServiceInstance.yaml' + discriminator: + propertyName: type + mapping: + managed: './ManagedServiceInstance.yaml' + user-provided: './UserProvidedServiceInstance.yaml' \ No newline at end of file diff --git a/apis/cf/latest/components/schemas/UserProvidedServiceInstance.yaml b/apis/cf/latest/components/schemas/UserProvidedServiceInstance.yaml index 23a3f9f..b1b8ece 100644 --- a/apis/cf/latest/components/schemas/UserProvidedServiceInstance.yaml +++ b/apis/cf/latest/components/schemas/UserProvidedServiceInstance.yaml @@ -33,9 +33,6 @@ properties: type: string format: uri description: URL for route service - credentials: - type: object - description: Service credentials relationships: type: object properties: @@ -53,6 +50,8 @@ properties: $ref: './Link.yaml' service_route_bindings: $ref: './Link.yaml' + credentials: + $ref: './Link.yaml' metadata: $ref: './Metadata.yaml' required: diff --git a/apis/cf/latest/paths/ServiceCredentialBindings.yaml b/apis/cf/latest/paths/ServiceCredentialBindings.yaml index f2780ee..b8d1638 100644 --- a/apis/cf/latest/paths/ServiceCredentialBindings.yaml +++ b/apis/cf/latest/paths/ServiceCredentialBindings.yaml @@ -126,6 +126,11 @@ oneOf: - $ref: ../components/schemas/AppCredentialBinding.yaml - $ref: ../components/schemas/KeyCredentialBinding.yaml + discriminator: + propertyName: type + mapping: + app: '../components/schemas/AppCredentialBinding.yaml' + key: '../components/schemas/KeyCredentialBinding.yaml' '202': description: Accepted headers: @@ -160,6 +165,11 @@ oneOf: - $ref: ../components/schemas/AppCredentialBinding.yaml - $ref: ../components/schemas/KeyCredentialBinding.yaml + discriminator: + propertyName: type + mapping: + app: '../components/schemas/AppCredentialBinding.yaml' + key: '../components/schemas/KeyCredentialBinding.yaml' links: app: operationId: getApp @@ -194,6 +204,11 @@ oneOf: - $ref: ../components/schemas/AppCredentialBinding.yaml - $ref: ../components/schemas/KeyCredentialBinding.yaml + discriminator: + propertyName: type + mapping: + app: '../components/schemas/AppCredentialBinding.yaml' + key: '../components/schemas/KeyCredentialBinding.yaml' '401': $ref: '../components/responses/Unauthorized.yaml' '404': diff --git a/apis/cf/latest/paths/ServiceInstances.yaml b/apis/cf/latest/paths/ServiceInstances.yaml index 2e2d050..79c01ad 100644 --- a/apis/cf/latest/paths/ServiceInstances.yaml +++ b/apis/cf/latest/paths/ServiceInstances.yaml @@ -298,6 +298,11 @@ oneOf: - $ref: ../components/schemas/ManagedServiceInstance.yaml - $ref: ../components/schemas/UserProvidedServiceInstance.yaml + discriminator: + propertyName: type + mapping: + managed: '../components/schemas/ManagedServiceInstance.yaml' + user-provided: '../components/schemas/UserProvidedServiceInstance.yaml' links: space: operationId: getSpace @@ -332,6 +337,11 @@ oneOf: - $ref: ../components/schemas/ManagedServiceInstance.yaml - $ref: ../components/schemas/UserProvidedServiceInstance.yaml + discriminator: + propertyName: type + mapping: + managed: '../components/schemas/ManagedServiceInstance.yaml' + user-provided: '../components/schemas/UserProvidedServiceInstance.yaml' links: space: operationId: getSpace