-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from edx/alangsto/customize_basepath
- Loading branch information
Showing
8 changed files
with
199 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
""" | ||
REST API URLs for testing make_docs_urls with url pattern specified. | ||
""" | ||
|
||
from django.conf.urls import url | ||
|
||
from edx_api_doc_tools import make_api_info, make_docs_urls | ||
|
||
from .views import HedgehogInfoView, HedgehogUndocumentedView | ||
|
||
|
||
urlpatterns = [] | ||
|
||
urlpatterns += [ | ||
url(r'/api/hedgehog/v1/info', HedgehogInfoView.as_view()), | ||
url(r'/api/hedgehog/v1/undoc-view', HedgehogUndocumentedView.as_view()), | ||
url(r'/test/hedgehog/v1/info', HedgehogInfoView.as_view()), | ||
url(r'/test/hedgehog/v1/undoc-view', HedgehogUndocumentedView.as_view()), | ||
] | ||
|
||
display_urls = [ | ||
url(r'/test/hedgehog/v1/info', HedgehogInfoView.as_view()), | ||
] | ||
|
||
urlpatterns += make_docs_urls( | ||
make_api_info( | ||
title="edX Hedgehog Service API", | ||
version="v1", | ||
email="hedgehog-support@example.com", | ||
description="A REST API for interacting with the edX hedgehog service.", | ||
), | ||
api_url_patterns=display_urls, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
actual_schema.json | ||
actual_schema_with_patterns.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{ | ||
"basePath": "/test/hedgehog/v1", | ||
"consumes": [ | ||
"application/json" | ||
], | ||
"definitions": {}, | ||
"host": "testserver", | ||
"info": { | ||
"contact": { | ||
"email": "hedgehog-support@example.com" | ||
}, | ||
"description": "A REST API for interacting with the edX hedgehog service.", | ||
"title": "edX Hedgehog Service API", | ||
"version": "v1" | ||
}, | ||
"paths": { | ||
"/info": { | ||
"get": { | ||
"description": "Returns a object with keys and values describing the API.\n\nArgs:\n request: a Request.", | ||
"operationId": "info_list", | ||
"parameters": [], | ||
"responses": { | ||
"200": { | ||
"description": "" | ||
} | ||
}, | ||
"summary": "Get information about the Hedgehog API.", | ||
"tags": [ | ||
"info" | ||
] | ||
}, | ||
"parameters": [], | ||
"put": { | ||
"description": "This is to show the difference in treatment. This is a second\nparagraph which will be included in the docs.", | ||
"operationId": "info_update", | ||
"parameters": [], | ||
"responses": { | ||
"200": { | ||
"description": "" | ||
} | ||
}, | ||
"summary": "Not really an endpoint at all, but has no @schema decorator.", | ||
"tags": [ | ||
"info" | ||
] | ||
} | ||
} | ||
}, | ||
"produces": [ | ||
"application/json" | ||
], | ||
"schemes": [ | ||
"http" | ||
], | ||
"security": [ | ||
{ | ||
"Basic": [] | ||
} | ||
], | ||
"securityDefinitions": { | ||
"Basic": { | ||
"type": "basic" | ||
} | ||
}, | ||
"swagger": "2.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters