From 677bdac42924a73a974ec01cbdb85655464abe93 Mon Sep 17 00:00:00 2001 From: Andrew Shannon Brown Date: Fri, 26 Oct 2018 11:18:09 -0700 Subject: [PATCH] Version 2.0.10 (#10) * Add clone flag api * Add specification of new environments when project is created (fixes https://github.com/launchdarkly/ld-openapi/issues/7) * Bump version to 2.0.10 --- spec/definitions.yaml | 25 ++++++++++++++++++++++++- spec/info.yaml | 2 +- spec/parameters.yaml | 34 ++++++++++++---------------------- spec/paths/flags.yaml | 1 + 4 files changed, 38 insertions(+), 24 deletions(-) diff --git a/spec/definitions.yaml b/spec/definitions.yaml index 5730934..90e56de 100644 --- a/spec/definitions.yaml +++ b/spec/definitions.yaml @@ -445,7 +445,30 @@ Environment: type: array items: type: string - description: An array of tags for this environment. + description: An array of tags for this environment. +EnvironmentPost: + type: object + properties: + name: + type: string + description: The name of the new environment. + example: Development + key: + type: string + description: A project-unique key for the new environment. + example: dev + color: + type: string + description: A color swatch (as an RGB hex value with no leading '#', e.g. C8C8C8). + example: "417505" + defaultTtl: + type: number + description: The default TTL for the new environment. + example: 0 + required: + - name + - key + - color User: type: object properties: diff --git a/spec/info.yaml b/spec/info.yaml index 69ff247..e6d5624 100644 --- a/spec/info.yaml +++ b/spec/info.yaml @@ -8,4 +8,4 @@ contact: license: name: Apache 2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html -version: 2.0.9 +version: 2.0.10 diff --git a/spec/parameters.yaml b/spec/parameters.yaml index ed2373d..c0d5638 100644 --- a/spec/parameters.yaml +++ b/spec/parameters.yaml @@ -119,6 +119,11 @@ ProjectPostRequest: key: type: string example: new-project + environments: + type: array + items: + $ref: '#/definitions/EnvironmentPost' + minLength: 1 required: - name - key @@ -128,28 +133,7 @@ EnvironmentPostRequest: required: true description: New environment. schema: - type: object - properties: - name: - type: string - description: The name of the new environment. - example: Development - key: - type: string - description: A project-unique key for the new environment. - example: dev - color: - type: string - description: A color swatch (as an RGB hex value with no leading '#', e.g. C8C8C8). - example: "417505" - defaultTtl: - type: number - description: The default TTL for the new environment. - example: 0 - required: - - name - - key - - color + $ref: '#/definitions/EnvironmentPost' ProjectKey: name: projectKey in: path @@ -174,6 +158,12 @@ FeatureFlagKey: required: true description: The feature flag's key. The key identifies the flag in your code. type: string +CloneFlagKeyQuery: + name: clone + in: query + required: false + description: The key of the feature flag to be cloned. The key identifies the flag in your code. For example, setting clone=flagKey will copy the full targeting configuration for all environments (including on/off state) from the original flag to the new flag. + type: string UserSegmentKey: name: userSegmentKey in: path diff --git a/spec/paths/flags.yaml b/spec/paths/flags.yaml index f201b88..57c7a4c 100644 --- a/spec/paths/flags.yaml +++ b/spec/paths/flags.yaml @@ -21,6 +21,7 @@ Flags: parameters: - $ref: '#/parameters/ProjectKey' - $ref: '#/parameters/FeatureFlagPostRequest' + - $ref: '#/parameters/CloneFlagKeyQuery' responses: '201': $ref: '#/responses/Standard201'