diff --git a/.gitattributes b/.gitattributes index b9956297867bc36116344efce8d107315920ad4b..1d5310b0d98e1eabf77af7239e14184bc232e3fe 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4239,7 +4239,7 @@ SAS/LSMR/bin/lsmr_testdatabase -text SAS/LSMR/bin/lsmr_testldap -text SAS/LSMR/doc/LSMR.md -text SAS/LSMR/doc/package.dox -text -SAS/LSMR/docker/README -text +SAS/LSMR/docker/README.md -text SAS/LSMR/docker/lsmr-postgres/Dockerfile -text SAS/LSMR/docker/lsmr-postgres/init.sql -text SAS/LSMR/docker/lsmr/Dockerfile -text diff --git a/SAS/LSMR/doc/LSMR.md b/SAS/LSMR/doc/LSMR.md index 907432d367d36ab9aa1777c2fc583565a1cbac91..d41cdb56415cc2e018c0c7a076e231fbab841d9f 100644 --- a/SAS/LSMR/doc/LSMR.md +++ b/SAS/LSMR/doc/LSMR.md @@ -37,6 +37,7 @@ meetings with stakeholders.* TODO ### Testing + TODO tests are missing - *How do you run unit tests?* TODO - *How do you run integration tests?* TODO @@ -45,8 +46,10 @@ TODO tests are missing ### Build & Deploy There is cmake integration for development work and testing. -For production deplyoment, the production database has to be configured in settings.py. -This should be best served through Nginx or Apache, so you want to collect static files and reference the wsgi.py. +For production deployment, the production database has to be configured in settings.py. +This should be best served through Nginx or Apache, so you want to collect static files and reference the wsgi.py. + +A docker environment is setup in ../docker, see ../docker/README.md - - - ## OPERATIONS @@ -93,4 +96,4 @@ TODO ### Operations Documentation -*e.g. Please refer to URL X for Operations Documentation* \ No newline at end of file +*e.g. Please refer to URL X for Operations Documentation* diff --git a/SAS/LSMR/docker/README b/SAS/LSMR/docker/README.md similarity index 100% rename from SAS/LSMR/docker/README rename to SAS/LSMR/docker/README.md diff --git a/SAS/LSMR/src/CMakeLists.txt b/SAS/LSMR/src/CMakeLists.txt index 8d07040bff39ba3f3e3335eba0e05c88af41b20a..d5c88c6a6af8752bcb47af25afc7b7be70a577f7 100644 --- a/SAS/LSMR/src/CMakeLists.txt +++ b/SAS/LSMR/src/CMakeLists.txt @@ -14,6 +14,8 @@ find_python_module(django_filters REQUIRED) # pip install django-filter find_python_module(django_auth_ldap REQUIRED) # sudo apt-get install python3-django-python3-ldap python3-django-auth-ldap find_python_module(coreapi REQUIRED) # sudo apt-get install python3-coreapi #find_python_module(jsoneditor REQUIRED) # pip install "git+git://github.com/nnseva/django-jsoneditor.git" + +# modules for swagger API export find_python_module(drf_yasg REQUIRED) # pip install drf-yasg find_python_module(flex REQUIRED) # pip install flex find_python_module(swagger_spec_validator REQUIRED) # pip install swagger-spec-validator diff --git a/SAS/LSMR/src/lsmr/lsmrapp/viewsets/lofar_viewset.py b/SAS/LSMR/src/lsmr/lsmrapp/viewsets/lofar_viewset.py index bba2500c20290b7ca659207b1a645efb05427802..d8b0c02c499ff59222c4aaf439815cfacc827fa5 100644 --- a/SAS/LSMR/src/lsmr/lsmrapp/viewsets/lofar_viewset.py +++ b/SAS/LSMR/src/lsmr/lsmrapp/viewsets/lofar_viewset.py @@ -1,5 +1,8 @@ """ A viewset extended with annotation and other common generic behaviours. + +Adds the following functionality: +- Swagger API annotation """ from rest_framework import viewsets diff --git a/SAS/LSMR/src/lsmr/urls.py b/SAS/LSMR/src/lsmr/urls.py index 97f8f63c0711e1a932afcf1694b726f3731186e5..067380316580c638aefd791a319e278555b14e84 100644 --- a/SAS/LSMR/src/lsmr/urls.py +++ b/SAS/LSMR/src/lsmr/urls.py @@ -28,7 +28,8 @@ from drf_yasg import openapi # Django style patterns # -schema_view = get_schema_view( +# schema for Swagger API +swagger_schema_view = get_schema_view( openapi.Info( title="LOFAR Internal API", default_version='v1', @@ -45,9 +46,9 @@ schema_view = get_schema_view( urlpatterns = [ path('admin/', admin.site.urls), path('docs/', include_docs_urls(title='LSMR API')), - re_path(r'^swagger(?P<format>\.json|\.yaml)$', schema_view.without_ui(cache_timeout=0), name='schema-json'), - path('swagger/', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'), - path('redoc/', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'), + re_path(r'^swagger(?P<format>\.json|\.yaml)$', swagger_schema_view.without_ui(cache_timeout=0), name='schema-json'), + path('swagger/', swagger_schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'), + path('redoc/', swagger_schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'), ]