drf-jsonschema


Namedrf-jsonschema JSON
Version 0.2.2 PyPI version JSON
download
home_page
SummaryA package that constructs JsonSchema validation error into error tree for Django Rest Framework with custom error message in compliance with the DRF error message.
upload_time2023-05-30 08:24:08
maintainer
docs_urlNone
author
requires_python>=3.8
licenseMIT License Copyright (c) 2023 Kira Technologies Pty Ltd Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords jsonschema drf
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            =============================
drf-jsonschema
=============================
drf-jsonschema, created by Kiratech from extending `jsonschema <https://github.com/python-jsonschema/jsonschema>`_ package.
This package provides JsonSchemaField and constructs JsonSchema validation error into error tree for Django Rest Framework with custom error message. 

This package will install `jsonschema <https://github.com/python-jsonschema/jsonschema>`_ automatically so manual installation is not necessary.

Quick Start
-----------

1. You can use JsonSchemaFieldValidator in Django's ``models.py`` as such::

    from drf_jsonschema import JsonSchemaFieldValidator
    ...
    ...
    json_data = models.JSONField(validators=[JsonSchemaFieldValidator(schema=your_json_schema)])

2. On ``serializers.py``, modify the serializer field mapping from ``JSONField`` to ``JSONSchemaField`` as the example below::

    from drf_jsonschema.serializers import JsonSchemaModelSerializer

    class YourSerializer(JsonSchemaModelSerializer):
        ...

3. For more information, visit `jsonschema <https://github.com/python-jsonschema/jsonschema>`_ 

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "drf-jsonschema",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "jsonschema,drf",
    "author": "",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/a6/db/5f901b477af43fd41f49ec058c0a007df3e06ca081d050aa9de5c7405022/drf-jsonschema-0.2.2.tar.gz",
    "platform": null,
    "description": "=============================\r\ndrf-jsonschema\r\n=============================\r\ndrf-jsonschema, created by Kiratech from extending `jsonschema <https://github.com/python-jsonschema/jsonschema>`_ package.\r\nThis package provides JsonSchemaField and constructs JsonSchema validation error into error tree for Django Rest Framework with custom error message. \r\n\r\nThis package will install `jsonschema <https://github.com/python-jsonschema/jsonschema>`_ automatically so manual installation is not necessary.\r\n\r\nQuick Start\r\n-----------\r\n\r\n1. You can use JsonSchemaFieldValidator in Django's ``models.py`` as such::\r\n\r\n    from drf_jsonschema import JsonSchemaFieldValidator\r\n    ...\r\n    ...\r\n    json_data = models.JSONField(validators=[JsonSchemaFieldValidator(schema=your_json_schema)])\r\n\r\n2. On ``serializers.py``, modify the serializer field mapping from ``JSONField`` to ``JSONSchemaField`` as the example below::\r\n\r\n    from drf_jsonschema.serializers import JsonSchemaModelSerializer\r\n\r\n    class YourSerializer(JsonSchemaModelSerializer):\r\n        ...\r\n\r\n3. For more information, visit `jsonschema <https://github.com/python-jsonschema/jsonschema>`_ \r\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 Kira Technologies Pty Ltd  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "A package that constructs JsonSchema validation error into error tree for Django Rest Framework with custom error message in compliance with the DRF error message.",
    "version": "0.2.2",
    "project_urls": null,
    "split_keywords": [
        "jsonschema",
        "drf"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a934c88c9e82d8b6896819f3c93425d2e7e1e6de1a0d56c8e9f79ec52b235fa7",
                "md5": "5ba28bca91efa8a78f9d929dca90f57a",
                "sha256": "29f08e2f8e15f4175563086066a02f21fa779f2eb12d02a4ba5359432b20fdde"
            },
            "downloads": -1,
            "filename": "drf_jsonschema-0.2.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5ba28bca91efa8a78f9d929dca90f57a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 9758,
            "upload_time": "2023-05-30T08:24:06",
            "upload_time_iso_8601": "2023-05-30T08:24:06.795604Z",
            "url": "https://files.pythonhosted.org/packages/a9/34/c88c9e82d8b6896819f3c93425d2e7e1e6de1a0d56c8e9f79ec52b235fa7/drf_jsonschema-0.2.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a6db5f901b477af43fd41f49ec058c0a007df3e06ca081d050aa9de5c7405022",
                "md5": "3586c1921a39ae612c4d69af35bd5956",
                "sha256": "69f25382b82f86c8131d09231058deb5ba5e1a460a15474c6ece0734d365a9f2"
            },
            "downloads": -1,
            "filename": "drf-jsonschema-0.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "3586c1921a39ae612c4d69af35bd5956",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 7466,
            "upload_time": "2023-05-30T08:24:08",
            "upload_time_iso_8601": "2023-05-30T08:24:08.737677Z",
            "url": "https://files.pythonhosted.org/packages/a6/db/5f901b477af43fd41f49ec058c0a007df3e06ca081d050aa9de5c7405022/drf-jsonschema-0.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-30 08:24:08",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "drf-jsonschema"
}
        
Elapsed time: 1.07306s