Skip to content

Commit

Permalink
Merge pull request #2237 from uktrade/LTD-5533-data-workspace-api-gen…
Browse files Browse the repository at this point in the history
…eration

Ltd 5533 data workspace api generation
  • Loading branch information
kevincarrogan authored Oct 21, 2024
2 parents 4ed7e98 + e31964a commit 35bdc7a
Show file tree
Hide file tree
Showing 10 changed files with 5,982 additions and 410 deletions.
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ omit =
./*/__init__.py
./*/models.py
./*/migrations/*
./api/conf/schema_generator_urls.py
./api/conf/settings.py
./api/conf/wsgi.py
./static/management/*
Expand Down
4 changes: 2 additions & 2 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ watchdog = {extras = ["watchmedo"], version = "*"}
diff-pdf-visually = "~=1.7.0"
pytest-circleci-parallelized = "~=0.1.0"
moto = {extras = ["s3"], version = "==5.0.3"}
drf-spectacular = "*"

[packages]
factory-boy = "~=2.12.0"
Expand All @@ -29,7 +30,7 @@ faker = "~=23.2.1"
boto3 = "~=1.26.17"
django-activity-stream = "~=0.10.0"
django-allow-cidr = "~=0.5.0"
django-elasticsearch-dsl = "~=7.2.2"
django-elasticsearch-dsl = "~=7.4.0"
django-elasticsearch-dsl-drf = "~=0.22.5"
django-environ = "~=0.9.0"
django-health-check = "~=3.18.1"
Expand All @@ -48,7 +49,6 @@ defusedxml = "~=0.6.0"
xmlschema = "~=1.2.0"
notifications-python-client = "~=5.7.1"
dataclasses = "~=0.6"
# endesive = "~=1.5.9" (not included here as installed in a later jenkins step. Uncomment if working locally)
pypdf2 = "~=1.27.5"
cryptography = "~=43.0.1"
sentry-sdk = "~=2.8.0"
Expand Down
1,055 changes: 649 additions & 406 deletions Pipfile.lock

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions api/conf/schema_generator_urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.urls import path, include


urlpatterns = [
path("data-workspace/", include("api.data_workspace.urls")),
]
2 changes: 2 additions & 0 deletions api/conf/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
"api.survey",
"django_db_anonymiser.db_anonymiser",
"reversion",
"drf_spectacular",
]

MOCK_VIRUS_SCAN_ACTIVATE_ENDPOINTS = env("MOCK_VIRUS_SCAN_ACTIVATE_ENDPOINTS")
Expand Down Expand Up @@ -193,6 +194,7 @@
"DEFAULT_METADATA_CLASS": "api.core.metadata.SimpleMetadataForAllMethods",
"DEFAULT_PARSER_CLASSES": ("rest_framework.parsers.JSONParser", "rest_framework.parsers.FormParser"),
"DEFAULT_PAGINATION_CLASS": "api.conf.pagination.MaxPageNumberPagination",
"DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema",
"PAGE_SIZE": 25,
"TEST_REQUEST_DEFAULT_FORMAT": "json",
"EXCEPTION_HANDLER": "api.core.handlers.lite_exception_handler",
Expand Down
4 changes: 3 additions & 1 deletion api/conf/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
path("routing-rules/", include("api.workflow.routing_rules.urls")),
path("licences/", include("api.licences.urls")),
path("open-general-licences/", include("api.open_general_licences.urls")),
path("data-workspace/", include("api.data_workspace.urls")),
path(
"data-workspace/", include("api.data_workspace.urls")
), # when changing this value please update schema_generator_urls.py
path("external-data/", include("api.external_data.urls")),
path("bookmarks/", include("api.bookmarks.urls")),
path("appeals/", include("api.appeals.urls")),
Expand Down
11 changes: 11 additions & 0 deletions api/data_workspace/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Data Workspace API

The endpoints here are for exposing data to Data Workspace.

## Generate schema documentation

The schema documentation can be generated by running the following command:

```
# ./manage.py spectacular --urlconf api.conf.schema_generator_urls --file api/data_workspace/openapi.yaml
```
Loading

0 comments on commit 35bdc7a

Please sign in to comment.