.. image:: https://travis-ci.org/Trax-air/swagger-parser.svg?branch=master
:alt: Travis status
:target: https://travis-ci.org/Trax-air/swagger-parser
.. image:: https://badges.gitter.im/Trax-air/swagger-parser.svg
:alt: Join the chat at https://gitter.im/Trax-air/swagger-parser
:target: https://gitter.im/Trax-air/swagger-parser?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
.. image:: https://img.shields.io/pypi/v/swagger-parser.svg
:target: https://pypi.python.org/pypi/swagger-parser/
swagger-parser
==============
Swagger-parser is a python module giving you access to some interesting data about your swagger file. Like getting a dictionary example from a definition name, get the definition of a dictionary, and more.
Related Libraries
-----------------
You may find related libraries to this one:
* https://github.com/Trax-air/swagger-tester: Auto-test your swagger API in your unit tests. All test calls are generated by your swagger file.
* https://github.com/Trax-air/swagger-stub: A stub you can use in your client's unit tests. All the HTTP calls to your swagger API are mocked by default. You can also add your own mocked_calls in your test functions.
* https://github.com/Trax-air/swagger-aggregator: Aggregate several swagger specs into one. Useful for your API gateways!
Example Usage
-------------
.. code:: python
from swagger_parser import SwaggerParser
parser = SwaggerParser(swagger_path='swagger_path') # Init with file
parser = SwaggerParser(swagger_dict={}) # Init with dictionary
# Get an example of dict for the definition Foo
parser.definitions_example.get('Foo')
# Get the definition of a dictionary
test = {
'foo': 'bar'
}
parser.get_dict_definition(test)
# Validate the definition of a dict
parser.validate_definition('Foo', test)
# Validate that the given data match a path specification
parser.validate_request('/foo', 'post', body=test, query={'foo': 'bar'})
# Get the possible return value of a path
# It will return a dictionary with keys as status_code
# and value as example of return value.
parser.get_request_data('/foo', 'post', body=test)
# Get an example of a correct body for a path
parser.get_send_request_correct_body('/foo', 'post')
Documentation
-------------
More documentation is available at https://swagger-parser.readthedocs.org/en/latest/.
Setup
-----
`make install` or `pip install swagger-parser`
License
-------
swagger-parser is licensed under http://opensource.org/licenses/MIT.
=======
History
=======
1.0.0 (2017-6-11)
-----------------
* Drop support for python 2.6, add support for python 3.5, python 3.6 and pypy
* Fix issue `#35 <https://github.com/Trax-air/swagger-parser/issues/35>`_
* `Add file parser tests and fixes for #40, #41, #42, #43, #44, #45 <https://github.com/Trax-air/swagger-parser/pull/39>`_, thanks to @mtherieau
* `Use isinstance for simple type checking <https://github.com/Trax-air/swagger-parser/pull/36>`_, thanks to @pankaj28843
* `Fixes for #31, #32, #33 <https://github.com/Trax-air/swagger-parser/pull/34>`_, thanks to @crudo10 and @beanqueen for the review
* `Bug fix when dictionary only contains 1 element <https://github.com/Trax-air/swagger-parser/pull/30>`_, thanks to @TenOs
* `Add tests for "official" petstore json and yaml <https://github.com/Trax-air/swagger-parser/pull/29>`_, thanks to @beanqueen
0.1.11 (2016-9-25)
------------------
* Support additionalProperties.
0.1.10 (2016-8-25)
------------------
* Don't choke if there are no definitions
* Generate operations without operationId
* Generate example from properties
0.1.9 (2016-7-28)
------------------
* Support array definitions.
0.1.8 (2016-5-11)
------------------
* Support type field to be an array.
* Use base path to validate request.
0.1.7 (2016-4-1)
------------------
* Support UTF-8 in swagger.yaml.
0.1.6 (2016-3-16)
------------------
* Add support for path-level parameters.
0.1.5 (2016-2-17)
------------------
* Add support for parameters references in path specs.
0.1.4 (2016-2-10)
------------------
* Handle string as status_code.
0.1.3 (2016-2-3)
------------------
* Fix a bug in get_response_example with schema only containing a type field.
0.1.2 (2016-2-3)
------------------
* Support schema with only a type field.
0.1.1 (2016-1-31)
------------------
* Change license to MIT.
0.1 (2016-1-28)
------------------
* First release on PyPI.
Raw data
{
"_id": null,
"home_page": "https://github.com/Trax-air/swagger-parser",
"name": "swagger-parser",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "swagger,parser,API,REST,swagger-parser",
"author": "Cyprien Guillemot",
"author_email": "cyprien.guillemot@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/9e/46/b7212e55c01cfc950d50a975858ee04193f796ad3e9911dfebc83848949a/swagger_parser-1.0.2.tar.gz",
"platform": "",
"description": ".. image:: https://travis-ci.org/Trax-air/swagger-parser.svg?branch=master\n :alt: Travis status\n :target: https://travis-ci.org/Trax-air/swagger-parser \n.. image:: https://badges.gitter.im/Trax-air/swagger-parser.svg\n :alt: Join the chat at https://gitter.im/Trax-air/swagger-parser\n :target: https://gitter.im/Trax-air/swagger-parser?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\n.. image:: https://img.shields.io/pypi/v/swagger-parser.svg\n :target: https://pypi.python.org/pypi/swagger-parser/\n\nswagger-parser\n==============\n\nSwagger-parser is a python module giving you access to some interesting data about your swagger file. Like getting a dictionary example from a definition name, get the definition of a dictionary, and more.\n\nRelated Libraries\n-----------------\nYou may find related libraries to this one:\n\n* https://github.com/Trax-air/swagger-tester: Auto-test your swagger API in your unit tests. All test calls are generated by your swagger file.\n* https://github.com/Trax-air/swagger-stub: A stub you can use in your client's unit tests. All the HTTP calls to your swagger API are mocked by default. You can also add your own mocked_calls in your test functions.\n* https://github.com/Trax-air/swagger-aggregator: Aggregate several swagger specs into one. Useful for your API gateways!\n\nExample Usage\n-------------\n\n.. code:: python\n\n from swagger_parser import SwaggerParser\n\n parser = SwaggerParser(swagger_path='swagger_path') # Init with file\n parser = SwaggerParser(swagger_dict={}) # Init with dictionary\n\n # Get an example of dict for the definition Foo\n parser.definitions_example.get('Foo')\n\n # Get the definition of a dictionary\n test = {\n 'foo': 'bar'\n }\n parser.get_dict_definition(test)\n\n # Validate the definition of a dict\n parser.validate_definition('Foo', test)\n\n # Validate that the given data match a path specification\n parser.validate_request('/foo', 'post', body=test, query={'foo': 'bar'})\n\n # Get the possible return value of a path\n # It will return a dictionary with keys as status_code\n # and value as example of return value.\n parser.get_request_data('/foo', 'post', body=test)\n\n # Get an example of a correct body for a path\n parser.get_send_request_correct_body('/foo', 'post')\n\nDocumentation\n-------------\n\nMore documentation is available at https://swagger-parser.readthedocs.org/en/latest/.\n\nSetup\n-----\n\n`make install` or `pip install swagger-parser`\n\nLicense\n-------\n\nswagger-parser is licensed under http://opensource.org/licenses/MIT.\n\n\n=======\nHistory\n=======\n\n1.0.0 (2017-6-11)\n-----------------\n\n* Drop support for python 2.6, add support for python 3.5, python 3.6 and pypy\n* Fix issue `#35 <https://github.com/Trax-air/swagger-parser/issues/35>`_\n* `Add file parser tests and fixes for #40, #41, #42, #43, #44, #45 <https://github.com/Trax-air/swagger-parser/pull/39>`_, thanks to @mtherieau\n* `Use isinstance for simple type checking <https://github.com/Trax-air/swagger-parser/pull/36>`_, thanks to @pankaj28843\n* `Fixes for #31, #32, #33 <https://github.com/Trax-air/swagger-parser/pull/34>`_, thanks to @crudo10 and @beanqueen for the review\n* `Bug fix when dictionary only contains 1 element <https://github.com/Trax-air/swagger-parser/pull/30>`_, thanks to @TenOs\n* `Add tests for \"official\" petstore json and yaml <https://github.com/Trax-air/swagger-parser/pull/29>`_, thanks to @beanqueen\n\n\n0.1.11 (2016-9-25)\n------------------\n\n* Support additionalProperties.\n\n0.1.10 (2016-8-25)\n------------------\n\n* Don't choke if there are no definitions\n* Generate operations without operationId\n* Generate example from properties\n\n0.1.9 (2016-7-28)\n------------------\n\n* Support array definitions.\n\n0.1.8 (2016-5-11)\n------------------\n\n* Support type field to be an array.\n* Use base path to validate request.\n\n0.1.7 (2016-4-1)\n------------------\n\n* Support UTF-8 in swagger.yaml.\n\n0.1.6 (2016-3-16)\n------------------\n\n* Add support for path-level parameters.\n\n0.1.5 (2016-2-17)\n------------------\n\n* Add support for parameters references in path specs.\n\n0.1.4 (2016-2-10)\n------------------\n\n* Handle string as status_code.\n\n0.1.3 (2016-2-3)\n------------------\n\n* Fix a bug in get_response_example with schema only containing a type field.\n\n0.1.2 (2016-2-3)\n------------------\n\n* Support schema with only a type field.\n\n0.1.1 (2016-1-31)\n------------------\n\n* Change license to MIT.\n\n0.1 (2016-1-28)\n------------------\n\n* First release on PyPI.\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Swagger parser giving useful informations about your swagger files",
"version": "1.0.2",
"project_urls": {
"Homepage": "https://github.com/Trax-air/swagger-parser"
},
"split_keywords": [
"swagger",
"parser",
"api",
"rest",
"swagger-parser"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3b46eb9c040886178ba2cfaa19bf6e7daa238cfaeffa48cf6b6c20173a24301b",
"md5": "f002c2ce96bdae75af2d714ac82d86a0",
"sha256": "251b5f9c54932ec140ba340afac66d75a72f8ed9185c4d35750949d689ec5860"
},
"downloads": -1,
"filename": "swagger_parser-1.0.2-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "f002c2ce96bdae75af2d714ac82d86a0",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 13100,
"upload_time": "2020-12-21T11:51:21",
"upload_time_iso_8601": "2020-12-21T11:51:21.151585Z",
"url": "https://files.pythonhosted.org/packages/3b/46/eb9c040886178ba2cfaa19bf6e7daa238cfaeffa48cf6b6c20173a24301b/swagger_parser-1.0.2-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9e46b7212e55c01cfc950d50a975858ee04193f796ad3e9911dfebc83848949a",
"md5": "db2f010dcb3635ae816641bd95633ae1",
"sha256": "9b37c3e23bdadc90716f4b0bae0e7943c1900ae2aed7735b228d65a6485cd17b"
},
"downloads": -1,
"filename": "swagger_parser-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "db2f010dcb3635ae816641bd95633ae1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 31264,
"upload_time": "2020-12-21T11:51:22",
"upload_time_iso_8601": "2020-12-21T11:51:22.415882Z",
"url": "https://files.pythonhosted.org/packages/9e/46/b7212e55c01cfc950d50a975858ee04193f796ad3e9911dfebc83848949a/swagger_parser-1.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2020-12-21 11:51:22",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Trax-air",
"github_project": "swagger-parser",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"requirements": [],
"tox": true,
"lcname": "swagger-parser"
}