Skip to content

Commit

Permalink
Merge pull request #124 from machristie/issue-109-coreapi-schema
Browse files Browse the repository at this point in the history
Issue #109: enable coreapi schema
  • Loading branch information
nuwang authored Dec 18, 2017
2 parents 93c2621 + 7a4c02d commit a70aae0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions django-cloudlaunch/cloudlaunch/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"""
from django.conf.urls import include
from django.conf.urls import url
from rest_framework.schemas import get_schema_view

from . import views

Expand Down Expand Up @@ -45,6 +46,9 @@
infrastructure_regex_pattern = r'api/v1/infrastructure/'
auth_regex_pattern = r'api/v1/auth/'
public_services_regex_pattern = r'api/v1/public_services/'

schema_view = get_schema_view(title='CloudLaunch API')

urlpatterns = [
url(r'api/v1/', include(router.urls)),
url(r'api/v1/', include(deployments_router.urls)),
Expand All @@ -63,4 +67,5 @@
url(r'accounts/', include('allauth.urls')),
# Public services
url(public_services_regex_pattern, include('public_appliances.urls')),
url(r'api/v1/schema/$', schema_view),
]
2 changes: 2 additions & 0 deletions django-cloudlaunch/cloudlaunch/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ class CorsProxyView(APIView):
"""
API endpoint that allows applications to be viewed or edited.
"""
exclude_from_schema = True

def get(self, request, format=None):
url = self.request.query_params.get('url')
response = requests.get(url)
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ djangorestframework==3.6.4
django-rest-auth==0.9.1 # login support for DRF through restful endpoints
django-allauth>=0.24.1 # pluggable social auth for django login
drf-nested-routers>=0.11.1 # Provides nested routing for DRF
coreapi==2.2.3 # Provides REST API schema

# Cloudbridge
git+git://github.com/gvlproject/cloudbridge
Expand Down

0 comments on commit a70aae0

Please sign in to comment.