Comments (4)
We originally had the flag configuration structured how you're proposing but decided to remove the return type because it can be inferred from the variant values.
The proposal regarding the rest endpoints could be doable either way. The current structure requires flagd to handle response type validation. The way you're proposing would require the provider to handle it. Perhaps we could consider having both.
What do you think @toddbaert?
from spec.
Yes, as @beeme1mr notes, with multiple endpoints, the API itself can enforce types to make sure the flag value returned is coherent with what the client expected. This is consistent with the existing semantics of the specification, which require strongly typed flag resolution methods where possible: https://github.com/open-feature/spec/blob/main/specification/flag-evaluation.md#conditional-requirement-1321
We could handle this in the client, but the mode of thinking with flagd clients/providers is to keep them as thin as possible, so that they are very simple to implement in any language, offloading the evaluation logic to flagd itself.
As far as the schema, the type can be inferred from the values, and mixed variants are not allowed. Put another way, since you can't mix variant values like this:
"variants": {
"on": true,
"off": 1
},
simply specifying your variants implicitly gives a type to the flag, making the "type" field a bit redundant. I think. There might be some reason it's valid to have a flag with no variants... but I can't think of any practical one.
from spec.
As a somewhat related point... we do have some code duplication in flagd as a consequence of this, and the generated endpoints. I would like to eventually rectify that issue with an upgrade to go 1.18 and the use of generics.
from spec.
Closing this for now
from spec.
Related Issues (20)
- Spec styling and consistency issues HOT 2
- [Question] `API.shutdown()` required in Go? HOT 5
- [Question] Static vs Dynamic context terminology HOT 1
- [bug] Multiple providers bound to one "name", and associated issues HOT 11
- Spec could be more clear about named-client/provider binding. Would "namespace" help? HOT 6
- Provider Initialization Fallback HOT 4
- Consider 0.7.0 release HOT 1
- Specify provider state after `shutdown()` HOT 8
- [Static-context Paradigm] How to handle errors in `on context changed` HOT 2
- Any plans to create feature flag code management project? HOT 5
- Manage context per named provider when using the static-context paradigm HOT 1
- Set context during provider registration when using the static-context paradigm HOT 3
- Redefine named clients as domain
- Clarification of reason for evaluation detail and evaluation. HOT 2
- DOC:Best practices or Cases HOT 10
- Proposal to move `Provider Status` field from provider to SDK, refine semantics around ContextChange events HOT 22
- Multi Provider for OpenFeature HOT 6
- tooling: Publish repo spec compliance docker container to github packages HOT 1
- Document compliance differences between different sdks HOT 4
- Consider the ability to opt-out from automatic functionality such as automatic provider ready events. HOT 16
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spec.