Framework to build/parse OpenAPI
Project description
OSC OpenAPI Framework
Build and parse OpenAPI data using its own structured python object.
Features
- Build OpenAPI data from structured object
- Parse OpenAPI data to structured object
Installation
You can install the pre-built python package through this command:
$ pip install osc-openapi-framework
Building
To build the package yourself:
$ make package
You can then install it with:
$ pip install dist/osc_openapi_framework-*.whl
Usage
Parsing OpenAPI Data
from osc_openapi_framework.openapi.parser import parse as openapi_parse
openapi_data = '''
openapi: 3.0.0
info:
title: Sample API
description: Optional multiline or single-line description in [CommonMark](http://commonmark.org/help/) or HTML.
version: 0.1.9
security:
- ApiKeyAuth: []
servers:
- url: http://api.example.com/v1
description: Optional server description, e.g. Main (production) server
- url: http://staging-api.example.com
description: Optional server description, e.g. Internal staging server for testing
paths:
/users:
get:
summary: Returns a list of users.
description: Optional extended description in CommonMark or HTML.
responses:
'200': # status code
description: A JSON array of user names
content:
application/json:
schema:
type: array
items:
type: string
'''
with open('/tmp/openapi_test', 'w') as fd:
fd.write(openapi_data)
oapi = openapi_parse('/tmp/openapi_test')
License
Copyright Outscale SAS
BSD-3-Clause
This project is compliant with REUSE.
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
Built Distribution
Close
Hashes for osc_openapi_framework-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c12fa2eb7d83b3eff3ee0f175dcdad8a2faff681ed4627b815c86c307e2731c |
|
MD5 | 86df8eae739a1c2fc14c1b2c8180c0e9 |
|
BLAKE2b-256 | fa733a2dddcddef967bc17bbb090a6c366c19487093b790f4c6ed5d20aec89dc |
Close
Hashes for osc_openapi_framework-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 558c0f1637b8d044b6be15156ef5663d75687c51c692eb038e8729280dca8429 |
|
MD5 | 80eb0b9cb8a81da4337bcd96cf7575f2 |
|
BLAKE2b-256 | 89f7ce91c0f830dda467b06c05a732425a9ac10c359a5ae93ff634ffa3cea383 |