-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ref. VNG-Realisatie/gemma-zaken#130 -- mogelijke foutantwoorden in OAS
Conform aan ZRC implementatie, neem de mogelijke foutantwoorden op in de `openapi.yaml` spec. Ook is dezelfde styling van foutpagina's overnomen uit het ZRC.
- Loading branch information
1 parent
63b8b54
commit 71f3f56
Showing
13 changed files
with
787 additions
and
77 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,4 @@ django-filter | |
djangorestframework-camel-case | ||
djangorestframework-filters | ||
drf-yasg | ||
zds-schema | ||
zds-schema==0.0.30 |
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 |
---|---|---|
@@ -1,76 +1,11 @@ | ||
REST_FRAMEWORK = { | ||
'DEFAULT_RENDERER_CLASSES': ( | ||
'djangorestframework_camel_case.render.CamelCaseJSONRenderer', | ||
), | ||
'DEFAULT_PARSER_CLASSES': ( | ||
'djangorestframework_camel_case.parser.CamelCaseJSONParser', | ||
), | ||
# 'DEFAULT_AUTHENTICATION_CLASSES': ( | ||
# 'oauth2_provider.contrib.rest_framework.OAuth2Authentication', | ||
# # 'rest_framework.authentication.SessionAuthentication', | ||
# # 'rest_framework.authentication.BasicAuthentication' | ||
# ), | ||
# 'DEFAULT_PERMISSION_CLASSES': ( | ||
# 'oauth2_provider.contrib.rest_framework.TokenHasReadWriteScope', | ||
# # 'rest_framework.permissions.IsAuthenticated', | ||
# # 'rest_framework.permissions.AllowAny', | ||
# ), | ||
'DEFAULT_VERSIONING_CLASS': 'rest_framework.versioning.URLPathVersioning', | ||
# | ||
# # Generic view behavior | ||
# 'DEFAULT_PAGINATION_CLASS': 'ztc.api.utils.pagination.HALPagination', | ||
'DEFAULT_FILTER_BACKENDS': ( | ||
'zds_schema.filters.Backend', | ||
# 'rest_framework.filters.SearchFilter', | ||
# 'rest_framework.filters.OrderingFilter', | ||
), | ||
# | ||
# # Filtering | ||
# 'SEARCH_PARAM': 'zoek', # 'search', | ||
# 'ORDERING_PARAM': 'sorteer', # 'ordering', | ||
# | ||
# Versioning | ||
'DEFAULT_VERSION': '1', | ||
'ALLOWED_VERSIONS': ('1', ), | ||
'VERSION_PARAM': 'version', | ||
# | ||
# # Exception handling | ||
# 'EXCEPTION_HANDLER': 'ztc.api.utils.exceptions.exception_handler', | ||
'TEST_REQUEST_DEFAULT_FORMAT': 'json', | ||
} | ||
from zds_schema.conf.api import BASE_REST_FRAMEWORK, BASE_SWAGGER_SETTINGS | ||
|
||
SWAGGER_SETTINGS = { | ||
# 'SECURITY_DEFINITIONS': { | ||
# 'OAuth2': { | ||
# 'type': 'oauth2', | ||
# 'flow': 'application', | ||
# 'tokenUrl': '/oauth2/token/', | ||
# 'scopes': { | ||
# 'write': 'Schrijftoegang tot de catalogus en gerelateerde objecten.', | ||
# 'read': 'Leestoegang tot de catalogus en gerelateerde objecten.' | ||
# } | ||
# }, | ||
# 'Bearer': { | ||
# 'type': 'apiKey', | ||
# 'name': 'Authorization', | ||
# 'in': 'header' | ||
# }, | ||
# }, | ||
'DEFAULT_AUTO_SCHEMA_CLASS': 'zds_schema.schema.AutoSchema', | ||
REST_FRAMEWORK = BASE_REST_FRAMEWORK.copy() | ||
|
||
|
||
SWAGGER_SETTINGS = BASE_SWAGGER_SETTINGS.copy() | ||
SWAGGER_SETTINGS.update({ | ||
'DEFAULT_INFO': 'drc.api.schema.info', | ||
'DEFAULT_FIELD_INSPECTORS': ( | ||
'drf_yasg.inspectors.CamelCaseJSONFilter', | ||
'drf_yasg.inspectors.RecursiveFieldInspector', | ||
'drf_yasg.inspectors.ReferencingSerializerInspector', | ||
'drf_yasg.inspectors.ChoiceFieldInspector', | ||
'drf_yasg.inspectors.FileFieldInspector', | ||
'drf_yasg.inspectors.DictFieldInspector', | ||
'drf_yasg.inspectors.HiddenFieldInspector', | ||
'drf_yasg.inspectors.RelatedFieldInspector', | ||
'drf_yasg.inspectors.SimpleFieldInspector', | ||
'drf_yasg.inspectors.StringDefaultFieldInspector', | ||
), | ||
'DEFAULT_FILTER_INSPECTORS': ( | ||
'zds_schema.inspectors.query.FilterInspector', | ||
) | ||
} | ||
# no geo things here | ||
'DEFAULT_FIELD_INSPECTORS': BASE_SWAGGER_SETTINGS['DEFAULT_FIELD_INSPECTORS'][1:] | ||
}) |
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,3 +1,4 @@ | ||
@import "page-header/all"; | ||
@import "content/all"; | ||
@import "link-block/all"; | ||
@import "error-detail/all"; |
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,2 @@ | ||
@import "error-detail"; | ||
@import "error-detail-properties"; |
22 changes: 22 additions & 0 deletions
22
src/drc/sass/components/error-detail/_error-detail-properties.scss
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,22 @@ | ||
.error-detail-properties { | ||
display: flex; | ||
flex-wrap: wrap; | ||
|
||
&__property { | ||
width: 20%; | ||
min-width: 200px; | ||
margin: 0; | ||
padding: 10px 0; | ||
|
||
font-weight: 700; | ||
} | ||
|
||
&__value { | ||
width: 80%; | ||
margin: 0; | ||
padding: 10px 0; | ||
|
||
font-weight: 700; | ||
color: $color-code; | ||
} | ||
} |
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,13 @@ | ||
@import '../../lib/responsive'; | ||
|
||
$error-detail-max-width: $breakpoint-laptop-l; | ||
|
||
.error-detail { | ||
max-width: $error-detail-max-width; | ||
margin: 0 auto; | ||
|
||
&__title { | ||
color: $color-black; | ||
border-bottom: solid 2px $color-vng-blue; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ $color-white: #FFF; | |
$color-black: #041A34; | ||
|
||
$color-vng-blue: #009FE3; | ||
$color-code: #D14; |
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,23 @@ | ||
{% extends "master.html" %} | ||
{% load staticfiles %} | ||
|
||
|
||
{% block content %} | ||
<article class="error-detail"> | ||
|
||
<h1 class="error-detail__title"><code>{{ type }}</code> fouttype</h1> | ||
|
||
<dl class="error-detail-properties"> | ||
<dt class="error-detail-properties__property">HTTP Status code</dt> | ||
<dd class="error-detail-properties__value"><code>{{ status_code }}</code></dd> | ||
|
||
<dt class="error-detail-properties__property">Default title</dt> | ||
<dd class="error-detail-properties__value"><code>{{ default_detail }}</code></dd> | ||
|
||
<dt class="error-detail-properties__property">Default code</dt> | ||
<dd class="error-detail-properties__value"><code>{{ default_code }}</code></dd> | ||
</dl> | ||
|
||
|
||
</article> | ||
{% endblock %} |
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
Oops, something went wrong.