From 29afba67e1e17e6c7a13c11f584f727af4aa1a76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20ROCHER?= Date: Thu, 28 Jul 2016 15:46:35 +0200 Subject: [PATCH] Captitalize the name of the APIs --- rest_framework/schemas.py | 2 +- tests/test_schemas.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/rest_framework/schemas.py b/rest_framework/schemas.py index 5ce2e9e70..cd2c39258 100644 --- a/rest_framework/schemas.py +++ b/rest_framework/schemas.py @@ -180,7 +180,7 @@ class SchemaGenerator(object): for item in path.strip('/').split('/'): if '{' in item: continue - category.append(item) + category.append(item.capitalize()) actions = getattr(callback, 'actions', self.default_mapping) action = actions[method.lower()] diff --git a/tests/test_schemas.py b/tests/test_schemas.py index 2a15e0e64..8284c71c4 100644 --- a/tests/test_schemas.py +++ b/tests/test_schemas.py @@ -74,7 +74,7 @@ class TestRouterGeneratedSchema(TestCase): url='', title='Example API', content={ - 'example': { + 'Example': { 'list': coreapi.Link( url='/example/', action='get', @@ -104,7 +104,7 @@ class TestRouterGeneratedSchema(TestCase): url='', title='Example API', content={ - 'example': { + 'Example': { 'list': coreapi.Link( url='/example/', action='get', @@ -171,7 +171,7 @@ class TestSchemaGenerator(TestCase): url='', title='Test View', content={ - 'example-view': { + 'Example-view': { 'create': coreapi.Link( url='/example-view/', action='post', @@ -198,7 +198,7 @@ class TestSchemaAndSubSchemaGenerator(TestCase): url='', title='Test View', content={ - 'example': { + 'Example': { 'list': coreapi.Link( url='/example/', action='get', @@ -251,7 +251,7 @@ class TestSchemaAndSubSchemaGenerator(TestCase): ] ) }, - 'example-view': { + 'Example-view': { 'create': coreapi.Link( url='/{example_id}/example-view/', action='post',