Skip to content

Commit

Permalink
v4 public api fixes #3010 (#3048)
Browse files Browse the repository at this point in the history
* v4 public api fixes #3010

* docs

* change to expose recipe only

* docs

* formatting

* v4 tests

* renaming

* unused imports

Co-authored-by: Jared Lockhart <[email protected]>
  • Loading branch information
tiftran and jaredlockhart authored Jul 17, 2020
1 parent 68200a5 commit 7a56230
Show file tree
Hide file tree
Showing 16 changed files with 741 additions and 147 deletions.
4 changes: 4 additions & 0 deletions app/experimenter/base/management/commands/generate_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ def generateSchema():
elif "/api/v3/" in path:
for method in paths[path]:
paths[path][method]["tags"] = ["Rapid: Private"]
elif "/api/v4/" in path:
for method in paths[path]:
paths[path][method]["tags"] = ["Rapid: Public"]

return json.dumps(schema, indent=2)

@staticmethod
Expand Down
249 changes: 249 additions & 0 deletions app/experimenter/docs/openapi-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -8520,6 +8520,255 @@
]
}
},
"/api/v4/experiments/": {
"get": {
"operationId": "listExperiments",
"description": "",
"parameters": [],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"properties": {
"id": {
"type": "string",
"readOnly": true
},
"arguments": {
"properties": {
"slug": {
"type": "string",
"readOnly": true
},
"userFacingName": {
"type": "string",
"readOnly": true
},
"userFacingDescription": {
"type": "string",
"readOnly": true
},
"active": {
"type": "string",
"readOnly": true,
"default": true
},
"isEnrollmentPaused": {
"type": "string",
"readOnly": true
},
"features": {
"type": "array",
"items": {
"type": null
}
},
"proposedEnrollment": {
"type": "string",
"readOnly": true
},
"bucketConfig": {
"type": "string",
"readOnly": true
},
"startDate": {
"type": "string",
"readOnly": true
},
"endDate": {
"type": "string",
"readOnly": true
},
"branches": {
"type": "array",
"items": {
"properties": {
"slug": {
"type": "string",
"maxLength": 255,
"pattern": "^[-a-zA-Z0-9_]+$"
},
"ratio": {
"type": "integer",
"maximum": 2147483647,
"minimum": 0
},
"value": {
"type": "string",
"readOnly": true
}
},
"required": [
"slug"
]
}
},
"referenceBranch": {
"type": "string",
"readOnly": true
}
},
"required": [
"branches"
],
"type": "object"
},
"filter_expression": {
"type": "string",
"readOnly": true
},
"enabled": {
"type": "string",
"readOnly": true,
"default": true
}
},
"required": [
"arguments"
]
}
}
}
},
"description": ""
}
},
"tags": [
"Rapid: Public"
]
}
},
"/api/v4/experiments/{slug}/": {
"get": {
"operationId": "retrieveExperiment",
"description": "",
"parameters": [
{
"name": "slug",
"in": "path",
"required": true,
"description": "",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"id": {
"type": "string",
"readOnly": true
},
"arguments": {
"properties": {
"slug": {
"type": "string",
"readOnly": true
},
"userFacingName": {
"type": "string",
"readOnly": true
},
"userFacingDescription": {
"type": "string",
"readOnly": true
},
"active": {
"type": "string",
"readOnly": true,
"default": true
},
"isEnrollmentPaused": {
"type": "string",
"readOnly": true
},
"features": {
"type": "array",
"items": {
"type": null
}
},
"proposedEnrollment": {
"type": "string",
"readOnly": true
},
"bucketConfig": {
"type": "string",
"readOnly": true
},
"startDate": {
"type": "string",
"readOnly": true
},
"endDate": {
"type": "string",
"readOnly": true
},
"branches": {
"type": "array",
"items": {
"properties": {
"slug": {
"type": "string",
"maxLength": 255,
"pattern": "^[-a-zA-Z0-9_]+$"
},
"ratio": {
"type": "integer",
"maximum": 2147483647,
"minimum": 0
},
"value": {
"type": "string",
"readOnly": true
}
},
"required": [
"slug"
]
}
},
"referenceBranch": {
"type": "string",
"readOnly": true
}
},
"required": [
"branches"
],
"type": "object"
},
"filter_expression": {
"type": "string",
"readOnly": true
},
"enabled": {
"type": "string",
"readOnly": true,
"default": true
}
},
"required": [
"arguments"
]
}
}
},
"description": ""
}
},
"tags": [
"Rapid: Public"
]
}
},
"/api/v3/experiments/": {
"post": {
"operationId": "createExperiment",
Expand Down
Loading

0 comments on commit 7a56230

Please sign in to comment.