Skip to content

Commit

Permalink
docs: Return flag metadata instead of just flag keys
Browse files Browse the repository at this point in the history
Signed-off-by: Max VelDink <[email protected]>
  • Loading branch information
maxveldink committed Feb 15, 2024
1 parent 828f143 commit fbd8475
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions specification.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": []
},
Expand All @@ -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": []
}
Expand Down
6 changes: 3 additions & 3 deletions specification/sections/02-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
3 changes: 3 additions & 0 deletions specification/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fbd8475

Please sign in to comment.