Swagger parser giving useful informations about your swagger files
Project description
[![Build Status](https://travis-ci.org/Trax-air/swagger-parser.svg?branch=master)](https://travis-ci.org/Trax-air/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...
Example Usage
-------------
```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')
```
Setup
-----
`make install`
License
-------
swagger-parser is licensed under [GPL 3.0](http://opensource.org/licenses/GPL-3.0).
=======
History
=======
0.1 (2016-1-28)
------------------
* First release on 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...
Example Usage
-------------
```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')
```
Setup
-----
`make install`
License
-------
swagger-parser is licensed under [GPL 3.0](http://opensource.org/licenses/GPL-3.0).
=======
History
=======
0.1 (2016-1-28)
------------------
* First release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
swagger_parser-0.1.tar.gz
(31.8 kB
view details)
Built Distribution
File details
Details for the file swagger_parser-0.1.tar.gz
.
File metadata
- Download URL: swagger_parser-0.1.tar.gz
- Upload date:
- Size: 31.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ae4e37929acc07983bfb17db3083bd2eec06711b7855c39e4d47819c614a694 |
|
MD5 | f412dc6ad3d954c787759066302aa1df |
|
BLAKE2b-256 | 6d59a43292b908035acf4fbd4359e9b361deaedfc35a3df167d71761ada08966 |
Provenance
File details
Details for the file swagger_parser-0.1-py2.py3-none-any.whl
.
File metadata
- Download URL: swagger_parser-0.1-py2.py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce23ebe2d5286e41ff5c5df8025e56f1e10d3cdce32b25b500873494b17a7d06 |
|
MD5 | 8ac49f1d91e57358e26b83465b2251dd |
|
BLAKE2b-256 | 2b42bb60ef890746ec2fa5afec4e83604c83a3c177e17f7bdbdfa258477f2825 |