From fbd84755a17460f6e032049221a8660dc906a7fa Mon Sep 17 00:00:00 2001 From: Max VelDink Date: Thu, 15 Feb 2024 09:28:57 -0500 Subject: [PATCH] docs: Return flag metadata instead of just flag keys Signed-off-by: Max VelDink --- specification.json | 4 ++-- specification/sections/02-providers.md | 6 +++--- specification/types.md | 3 +++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/specification.json b/specification.json index 7ef1696f..653d8c9d 100644 --- a/specification.json +++ b/specification.json @@ -297,7 +297,7 @@ { "id": "Requirement 2.1.2", "machine_id": "requirement_2_1_2", - "content": "The provider `metadata` member or accessor MAY define an `allFlagKeys` field or accessor of type collection of strings, which identifies all available flag keys in the provider.", + "content": "The provider `metadata` member or accessor MAY define an `allFlagMetadata` field or accessor of type collection of [flag_metadata](../types.md", "RFC 2119 keyword": "MAY", "children": [] }, @@ -310,7 +310,7 @@ { "id": "Conditional Requirement 2.1.3.1", "machine_id": "conditional_requirement_2_1_3_1", - "content": "The accessor for `allFlagKeys` SHOULD be asynchronous.", + "content": "The accessor for `allFlagMetadata` SHOULD be asynchronous.", "RFC 2119 keyword": "SHOULD", "children": [] } diff --git a/specification/sections/02-providers.md b/specification/sections/02-providers.md index 748c4da1..1e347c96 100644 --- a/specification/sections/02-providers.md +++ b/specification/sections/02-providers.md @@ -28,10 +28,10 @@ provider.getMetadata().getName(); // "my-custom-provider" #### Requirement 2.1.2 -> The provider `metadata` member or accessor **MAY** define an `allFlagKeys` field or accessor of type collection of strings, which identifies all available flag keys in the provider. +> The provider `metadata` member or accessor **MAY** define an `allFlagMetadata` field or accessor of type collection of [flag_metadata](../types.md#flag-metadata), which identifies all available flag keys in the provider. ```typescript -provider.getMetadata().getAllFlagKeys(); // ['featureA', 'featureB'] +provider.getMetadata().getAllFlagMetadata(); // [{"key": "featureA", "type": "boolean"}, {"key": "featureB", "type": "string"}] ``` #### Condition 2.1.3 @@ -40,7 +40,7 @@ provider.getMetadata().getAllFlagKeys(); // ['featureA', 'featureB'] ##### Conditional Requirement 2.1.3.1 -> The accessor for `allFlagKeys` **SHOULD** be asynchronous. +> The accessor for `allFlagMetadata` **SHOULD** be asynchronous. ### 2.2 Flag Value Resolution diff --git a/specification/types.md b/specification/types.md index 61b13645..f94a5f2f 100644 --- a/specification/types.md +++ b/specification/types.md @@ -126,6 +126,9 @@ A structure containing the following fields: A structure which supports definition of arbitrary properties, with keys of type `string`, and values of type `boolean`, `string`, or `number`. +`key` is a required property with a value of `string`. +`type` is a required property with a `string` value of either `boolean`, `string`, `number`, or `structure`. + This structure is populated by a provider for use by an [Application Author](./glossary.md#application-author) via the [Evaluation API](./glossary.md#evaluation-api) or an [Application Integrator](./glossary.md#application-integrator) via [hooks](./sections/04-hooks.md). ### Provider Metadata