Skip to content

Commit

Permalink
Merge pull request #1439 from rajatdiptabiswas/api-doc-to-openapi-json
Browse files Browse the repository at this point in the history
Update 3scale.go
  • Loading branch information
oscerd authored May 2, 2020
2 parents c4593a6 + efe0866 commit efc8846
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
4 changes: 2 additions & 2 deletions addons/threescale/3scale.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}

Expand All @@ -64,7 +64,7 @@ const (
// ThreeScaleDescriptionPathAnnotation --
ThreeScaleDescriptionPathAnnotation = "discovery.3scale.net/description-path"
// ThreeScaleDescriptionPathDefaultValue --
ThreeScaleDescriptionPathDefaultValue = "/api-doc"
ThreeScaleDescriptionPathDefaultValue = "/openapi.json"

// ThreeScaleDiscoveryLabel --
ThreeScaleDiscoveryLabel = "discovery.3scale.net"
Expand Down
2 changes: 1 addition & 1 deletion addons/threescale/3scale_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
29 changes: 29 additions & 0 deletions deploy/traits.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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`)

0 comments on commit efc8846

Please sign in to comment.