feat!: change /api/v1/mfe_config to /api/mfe_config/v1

* This changes the API's path. The reasoning is that this is Version 1 of
  the mfe_config API, not Version 1 of the LMS's entire API, so the v1
  should come after mfe_config.
* Why does this matter? Firstly, consistency. Secondly, it affects our
  generated API documentation. If you visited
  https://courses.edx.org/api-docs, you could see that the API was
  listed under "v1" instead of "mfe_config".
This commit is contained in:
Kyle McCormick
2022-08-05 17:12:30 -04:00
committed by Kyle McCormick
parent 1b52ad58a5
commit c253ec4181
3 changed files with 5 additions and 5 deletions

View File

@@ -18,7 +18,7 @@ Decision
- A lightweight API will be created that returns the mfe configuration variables from the site configuration or django settings. `PR Discussion about django settings`_
- The API will be enabled or disabled using the setting ``ENABLE_MFE_CONFIG_API``.
- The API will take the mfe configuration in the ``MFE_CONFIG`` keyset in the site configuration (admin > site configuration > your domain) or in django settings.
- This API allows to consult the configurations by specific MFE. Making a request like ``/api/v1/mfe_config?mfe=mymfe`` will return the configuration defined in ``MFE_CONFIG_OVERRIDES["mymfe"]`` merged with the ``MFE_CONFIG`` configuration.
- This API allows to consult the configurations by specific MFE. Making a request like ``/api/mfe_config/v1?mfe=mymfe`` will return the configuration defined in ``MFE_CONFIG_OVERRIDES["mymfe"]`` merged with the ``MFE_CONFIG`` configuration.
- The API will have a mechanism to cache the response with ``MFE_CONFIG_API_CACHE_TIMEOUT`` variable.
- The API will live in lms/djangoapps because this is not something Studio needs to serve and it is a lightweight API. `PR Discussion`_
- The API will not require authentication or authorization.
@@ -26,7 +26,7 @@ Decision
Request::
GET http://lms.base.com/api/v1/mfe_config?mfe=learning
GET http://lms.base.com/api/mfe_config/v1?mfe=learning
Response::

View File

@@ -35,10 +35,10 @@ class MFEConfigView(APIView):
**Usage**
Get common config:
GET /api/v1/mfe_config
GET /api/mfe_config/v1
Get app config (common + app-specific overrides):
GET /api/v1/mfe_config?mfe=name_of_mfe
GET /api/mfe_config/v1?mfe=name_of_mfe
**GET Response Values**
```

View File

@@ -1028,5 +1028,5 @@ urlpatterns += [
# MFE API urls
urlpatterns += [
path('api/v1/mfe_config', include(('lms.djangoapps.mfe_config_api.urls', 'lms.djangoapps.mfe_config_api'), namespace='mfe_config_api'))
path('api/mfe_config/v1', include(('lms.djangoapps.mfe_config_api.urls', 'lms.djangoapps.mfe_config_api'), namespace='mfe_config_api'))
]