Browse Source

Update examples in ReadMe

dev
Peter Zaitcev 6 months ago
parent
commit
8e11452b63
1 changed files with 8 additions and 7 deletions
  1. + 8
    - 7
      README.md

+ 8
- 7
README.md

@ -5,17 +5,18 @@ and build clients and servers from that specification.
For more details, please refer the [Project Documentation]
### Example Usage
```python
import yaml
From the command line:
```bash
$ python -m openapi_parser data/petstore.yaml
```
From the Python:
```python
from openapi_parser.exporter import PackageWriter
from openapi_parser.parser.loader import *
from openapi_parser.parser.loader import OpenApiParser
def main():
with open('data/petstore.yaml') as f:
schema = yaml.safe_load(f)
parser = OpenApiParser(schema)
parser = OpenApiParser.open('data/petstore.yaml')
parser.load_all()
package_writer = PackageWriter(parser)

Loading…
Cancel
Save