-
Notifications
You must be signed in to change notification settings - Fork 465
Open
Description
In order to support transition from Pydantic, we need to decouple the SDKEnvironmentAPIView response schema from the former Pydantic model, keeping the schema intact:
-
Implement a static schema extracted from https://api.flagsmith.com/api/v1/docs/#/api/api_v1_environment-document_list.
-
Add a schema test based on openapi-core like this:
from openapi_core import OpenAPI
def test_environment_document_schema(sdk_client: APIClient, environment: Environment) -> None:
openapi = OpenAPI.from_file_path('../sdk/environment-document.json')
url = reverse("api-v1:environment-document")
request = sdk_client.get(url)
# raises an error if the request is invalid
result = openapi.unmarshal_request(request)
# not sure what we can assert here but the above line will
# error if the schema is invalid.
assert result, "THIS IS MEANT TO BE FROZEN, YOU DONUT"Metadata
Metadata
Assignees
Labels
No labels