From 9c064889627221af44cbdcfaedb484bb22e54ba8 Mon Sep 17 00:00:00 2001 From: Rajat Dipta Biswas Date: Thu, 30 Apr 2020 19:12:56 +0530 Subject: [PATCH 1/2] Update 3scale.go Fixes #1428 Changed references of "/api-doc" to "/openapi.json" --- addons/threescale/3scale.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/threescale/3scale.go b/addons/threescale/3scale.go index fa2250ce29..77643cb755 100644 --- a/addons/threescale/3scale.go +++ b/addons/threescale/3scale.go @@ -41,7 +41,7 @@ type threeScaleTrait struct { Path string `property:"path"` // The port where the service is exposed (default `80`) Port int `property:"port"` - // The path where the Open-API specification is published (default `/api-doc`) + // The path where the Open-API specification is published (default `/openapi.json`) DescriptionPath *string `property:"description-path"` } @@ -64,7 +64,7 @@ const ( // ThreeScaleDescriptionPathAnnotation -- ThreeScaleDescriptionPathAnnotation = "discovery.3scale.net/description-path" // ThreeScaleDescriptionPathDefaultValue -- - ThreeScaleDescriptionPathDefaultValue = "/api-doc" + ThreeScaleDescriptionPathDefaultValue = "/openapi.json" // ThreeScaleDiscoveryLabel -- ThreeScaleDiscoveryLabel = "discovery.3scale.net" From efe0866d0d3977a1637cb3c0ace90e94686152b6 Mon Sep 17 00:00:00 2001 From: Rajat Dipta Biswas Date: Thu, 30 Apr 2020 19:30:52 +0530 Subject: [PATCH 2/2] Update all /api-doc references - Updated the test 3scale_test.go - Manually changed references of /api-doc to /openapi.json in traits.yaml and 3scale.adoc --- addons/threescale/3scale_test.go | 2 +- deploy/traits.yaml | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/addons/threescale/3scale_test.go b/addons/threescale/3scale_test.go index 2ac850623f..ccdd126e53 100644 --- a/addons/threescale/3scale_test.go +++ b/addons/threescale/3scale_test.go @@ -59,7 +59,7 @@ func TestThreeScaleInjection(t *testing.T) { assert.Equal(t, "http", svc.Annotations["discovery.3scale.net/scheme"]) assert.Equal(t, "/", svc.Annotations["discovery.3scale.net/path"]) assert.Equal(t, "80", svc.Annotations["discovery.3scale.net/port"]) - assert.Equal(t, "/api-doc", svc.Annotations["discovery.3scale.net/description-path"]) + assert.Equal(t, "/openapi.json", svc.Annotations["discovery.3scale.net/description-path"]) } func TestThreeScaleInjectionNoAPIPath(t *testing.T) { diff --git a/deploy/traits.yaml b/deploy/traits.yaml index 9db71e0c4a..8128b8b43c 100755 --- a/deploy/traits.yaml +++ b/deploy/traits.yaml @@ -706,3 +706,32 @@ traits: - name: auto type: bool description: To automatically detect from the code if a Service needs to be created. +- name: 3scale + platform: false + profiles: + - Kubernetes + - Knative + - OpenShift + description: The 3scale trait can be used to automatically create annotations that + allow3scale to discover the generated service and make it available for API management.The + 3scale trait is disabled by default. + properties: + - name: enabled + type: bool + description: Can be used to enable or disable a trait. All traits share this common + property. + - name: auto + type: bool + description: Enables automatic configuration of the trait. + - name: scheme + type: string + description: The scheme to use to contact the service (default `http`) + - name: path + type: string + description: The path where the API is published (default `/`) + - name: port + type: int + description: The port where the service is exposed (default `80`) + - name: description-path + type: string + description: The path where the Open-API specification is published (default `/openapi.json`)