Last active
November 3, 2022 22:30
-
-
Save thomaspoignant/28c32b16382178cecc5e6257a45e68ac to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
basePath: / | |
definitions: | |
model.FlagEval: | |
properties: | |
value: {} | |
type: object | |
model.HealthResponse: | |
properties: | |
initialized: | |
description: Set to true if the HTTP server is started | |
example: true | |
type: boolean | |
type: object | |
model.InfoResponse: | |
properties: | |
cacheRefresh: | |
description: This is the last time when your flag file was read and store | |
in the internal cache. | |
example: "2022-06-13T11:22:55.941628+02:00" | |
type: string | |
type: object | |
model.RelayProxyRequest: | |
properties: | |
defaultValue: {} | |
user: | |
$ref: '#/definitions/model.UserRequest' | |
type: object | |
model.UserRequest: | |
properties: | |
anonymous: | |
description: Anonymous set if this is a logged-in user or not. | |
type: boolean | |
custom: | |
additionalProperties: true | |
description: Custom is a map containing all extra information for this user. | |
type: object | |
key: | |
description: Key is the identifier of the UserRequest. | |
type: string | |
type: object | |
modeldocs.AllFlags: | |
description: AllFlags contains the full list of all the flags available for the | |
user | |
properties: | |
flags: | |
additionalProperties: | |
$ref: '#/definitions/modeldocs.FlagState' | |
description: flags is the list of flag for the user. | |
type: object | |
valid: | |
description: |- | |
Valid if false it means there was an error (such as the data store not being available), | |
in which case no flag data is in this object. | |
example: false | |
type: boolean | |
type: object | |
modeldocs.FlagState: | |
properties: | |
timestamp: | |
description: Timestamp is the time when the flag was evaluated. | |
example: 1652113076 | |
type: integer | |
trackEvents: | |
description: TrackEvents this flag is trackable. | |
example: false | |
type: boolean | |
value: | |
description: Value is the flag value, it can be any JSON types. | |
variationType: | |
description: VariationType is the name of the variation used to have the flag | |
value. | |
example: variation-A | |
type: string | |
type: object | |
modeldocs.HTTPError: | |
properties: | |
message: | |
description: Message of your error | |
type: object | |
info: | |
contact: | |
email: [email protected] | |
name: GO feature flag relay proxy | |
url: https://gofeatureflag.org | |
description: "# Introduction\n\nThis API is documented in **OpenAPI format** and | |
describe the REST API of the **GO Feature Flag relay proxy**.\n\nThe relay proxy | |
is a component to evaluate your feature flags remotely when using **GO Feature | |
Flag**. \nThis API is mostly used by all the OpenFeature providers.\n" | |
license: | |
name: MIT | |
url: https://github.com/thomaspoignant/go-feature-flag/blob/main/LICENSE | |
title: GO Feature Flag relay proxy endpoints | |
x-logo: | |
altText: GO Feature Flag logo | |
url: https://raw.githubusercontent.com/thomaspoignant/go-feature-flag/main/logo_128.png | |
paths: | |
/health: | |
get: | |
description: |- | |
Making a **GET** request to the URL path `/health` will tell you if the relay proxy is ready to serve traffic. | |
This is useful especially for loadbalancer to know that they can send traffic to the service. | |
produces: | |
- application/json | |
responses: | |
"200": | |
description: OK | |
schema: | |
$ref: '#/definitions/model.HealthResponse' | |
summary: Health (health check) | |
/info: | |
get: | |
description: |- | |
Making a **GET** request to the URL path `/info` will tell give you information about the actual state of the relay proxy. | |
As of Today the level of information is small be we can improve this endpoint to returns more information. | |
produces: | |
- application/json | |
responses: | |
"200": | |
description: OK | |
schema: | |
$ref: '#/definitions/model.InfoResponse' | |
summary: Info | |
/v1/allflags: | |
post: | |
consumes: | |
- application/json | |
description: allflags returns all the flag for a specific user. | |
parameters: | |
- description: Payload of the user we want to challenge against the flag. | |
in: body | |
name: data | |
required: true | |
schema: | |
$ref: '#/definitions/model.RelayProxyRequest' | |
produces: | |
- application/json | |
responses: | |
"200": | |
description: Success | |
schema: | |
$ref: '#/definitions/modeldocs.AllFlags' | |
"400": | |
description: Bad Request | |
schema: | |
$ref: '#/definitions/modeldocs.HTTPError' | |
"500": | |
description: Internal server error | |
schema: | |
$ref: '#/definitions/modeldocs.HTTPError' | |
summary: allflags returns all the flag for a specific user. | |
/v1/feature/{flag_key}/eval: | |
post: | |
consumes: | |
- application/json | |
description: |- | |
Evaluate the users with the corresponding flag and return the value for the user. | |
Note that you will always have a usable value in the response, you can use the field failed to know if | |
an issue has occurred during the validation of the flag, in that case the value returned will be the | |
default value. | |
parameters: | |
- description: Payload of the user we want to get all the flags from. | |
in: body | |
name: data | |
required: true | |
schema: | |
$ref: '#/definitions/model.RelayProxyRequest' | |
- description: Name of your feature flag | |
in: path | |
name: flag_key | |
required: true | |
type: string | |
produces: | |
- application/json | |
responses: | |
"200": | |
description: Success | |
schema: | |
$ref: '#/definitions/model.FlagEval' | |
"400": | |
description: Bad Request | |
schema: | |
$ref: '#/definitions/modeldocs.HTTPError' | |
"500": | |
description: Internal server error | |
schema: | |
$ref: '#/definitions/modeldocs.HTTPError' | |
summary: Evaluate the users with the corresponding flag and return the value | |
for the user. | |
swagger: "2.0" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment