Swagger parser giving useful informations about your swagger files
Project description
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
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
0.1.1 (2016-1-31)
Change license to MIT.
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.1.tar.gz
(20.5 kB
view hashes)
Built Distribution
Close
Hashes for swagger_parser-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bbccab503fa19c9d65c77d4864088ba94267aff2cafc5a85056349ed258d764a |
|
MD5 | 917e225a032acf3022ea2e2b5556c238 |
|
BLAKE2b-256 | b9c624527430351623bc1c6417627ea3d39db2b45ac788267ef97e060b2b0be3 |