.. 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 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.
You may find related libraries to this one:
.. code:: python
from swagger_parser import SwaggerParser
parser = SwaggerParser(swagger_path='swagger_path') # Init with file parser = SwaggerParser(swagger_dict={}) # Init with dictionary
parser.definitions_example.get('Foo')
test = { 'foo': 'bar' } parser.get_dict_definition(test)
parser.validate_definition('Foo', test)
parser.validate_request('/foo', 'post', body=test, query={'foo': 'bar'})
parser.get_request_data('/foo', 'post', body=test)
parser.get_send_request_correct_body('/foo', 'post')
More documentation is available at https://swagger-parser.readthedocs.org/en/latest/.
make install
or pip install swagger-parser
swagger-parser is licensed under http://opensource.org/licenses/MIT.