open-feature / spec

OpenFeature specification
https://openfeature.dev
Apache License 2.0
661 stars 34 forks source link

Add sample provider OpenAPI schema #92

Closed toddbaert closed 2 years ago

toddbaert commented 2 years ago

A basic OpenAPI spec for OpenFeature provider-compliant HTTP communication.

I called the resource /flags initially, but /flags/{flag-key}/resolve is a more technically correct path, because we're not actually creating a flag resource instance here, but performing an evaluation. I subscribe to the thinking here... Not sure if that feels too awkward. Another option would be /flag-resolutions/{flag-key}, which is arguably more RESTful.

The resource essentially just evaluates a flag given a flag-key (path param), default-value (query param), and optional context JSON object in body. It responds with an OpenFeature compliant JSON body representing an resolution details object

Here's a rendering in a swaggerUI:

image

beeme1mr commented 2 years ago

Rename the file to provider.yml.

toddbaert commented 2 years ago

Now available here: https://github.com/open-feature/schemas