kyma-incubator/compass

System Broker: ServicePlan is not generated correctly for Director API Packages

koala7659 opened this issue · 2 comments

Description:

The model of APIPackages used by Director describes one or many Api Definitions inside each APiPackage where every Api Definition contains required TargetUrl field.

While fetching external System information from Central System Broker this whole structure is encoded within metadata field of ServicePlan abstraction. We noticed some issues regarding ServicePlan generation and the metadata contens.

Problems:

  1. The metadata of a ServicePlan received from the Central System Broker does not contain targetURL for all fetched API Definitions.

  2. Service Plan metadata representing API Definition is returned only if API specification is provided in Director.

Expected result:

  1. The metadata of a ServicePlan received from the Central System Broker should contain targetURL for each fetched API Definitions.

  2. API specification is optional so Service Plan metadata should be returned even if there is no API specification provided.

Hi @koala7659
What do you think of a response like that? Does it look sufficient for your usecases?

{
    "services": [
        {
            "id": "c79542c3-5520-4c8b-aca4-06504022c8fe",
            "name": "wordpress",
            "description": "my first wordpress application",
            "bindable": true,
            "plan_updateable": false,
            "plans": [
                {
                    "id": "cdbd629c-853b-4e1f-92ef-99fe032cf6e2",
                    "name": "pkg-app-1",
                    "description": "Foo bar",
                    "bindable": true,
                    "metadata": {
                        "apis": [
                            {
                                "id": "2950f213-095b-4899-a15a-3093beda5ee5",
                                "name": "reviews-v1",
                                "specification": {
                                    "format": "application/json",
                                    "type": "ODATA",
                                    "url": "http://localhost:8080/broker/specifications?app_id=c79542c3-5520-4c8b-aca4-06504022c8fe&package_id=cdbd629c-853b-4e1f-92ef-99fe032cf6e2&definition_id=2950f213-095b-4899-a15a-3093beda5ee5"
                                },
                                "target_url": "http://mywordpress.com/reviews"
                            },
                            {
                                "id": "65a46bda-4689-4fca-8960-223dfab6e958",
                                "name": "comments-v1",
                                "target_url": "http://mywordpress.com/comments"
                            },
                            {
                                "id": "796ca25d-0bfd-4ef7-89c6-90338c84f504",
                                "name": "xml",
                                "specification": {
                                    "format": "application/xml",
                                    "type": "ODATA",
                                    "url": "http://localhost:8080/broker/specifications?app_id=c79542c3-5520-4c8b-aca4-06504022c8fe&package_id=cdbd629c-853b-4e1f-92ef-99fe032cf6e2&definition_id=796ca25d-0bfd-4ef7-89c6-90338c84f504"
                                },
                                "target_url": "http://mywordpress.com/xml"
                            }
                        ],
                        "events": [
                            {
                                "id": "566587fc-8395-4213-9480-64c05e4c5c16",
                                "name": "reviews-v1",
                                "specification": {
                                    "format": "text/yaml",
                                    "type": "ASYNC_API",
                                    "url": "http://localhost:8080/broker/specifications?app_id=c79542c3-5520-4c8b-aca4-06504022c8fe&package_id=cdbd629c-853b-4e1f-92ef-99fe032cf6e2&definition_id=566587fc-8395-4213-9480-64c05e4c5c16"
                                }
                            },
                            {
                                "id": "95810581-3790-4176-9477-5ebb0af9b6f5",
                                "name": "comments-v1",
                                "specification": {
                                    "format": "text/yaml",
                                    "type": "ASYNC_API",
                                    "url": "http://localhost:8080/broker/specifications?app_id=c79542c3-5520-4c8b-aca4-06504022c8fe&package_id=cdbd629c-853b-4e1f-92ef-99fe032cf6e2&definition_id=95810581-3790-4176-9477-5ebb0af9b6f5"
                                }
                            }
                        ]
                    }
                }
            ],
            "metadata": {
                "displayName": "wordpress",
                "group": [
                    "production",
                    "experimental"
                ],
                "integrationSystemID": "",
                "name": "wordpress",
                "providerDisplayName": "provider name",
                "scenarios": [
                    "DEFAULT"
                ]
            }
        }
    ]
}

Fixed with release of system-broker as part of #1700