Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openapi/generate.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
npx openapi-generator-cli generate --global-property modelTests=false,modelDocs=false,apiTests=false,apiDocs=false -i openapi/output.swagger.json -g python -o ./src -c openapi/config.yaml
npx openapi-generator-cli generate --global-property modelTests=false,modelDocs=false,apiTests=false,apiDocs=false -i openapi/output.swagger.json -g python -o ./src -c openapi/config.yaml -t openapi/templates
60 changes: 60 additions & 0 deletions openapi/templates/README.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# {{{projectName}}}
{{#appDescriptionWithNewLines}}
{{{.}}}
{{/appDescriptionWithNewLines}}

This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: {{appVersion}}
- Package version: {{packageVersion}}
{{^hideGenerationTimestamp}}
- Build date: {{generatedDate}}
{{/hideGenerationTimestamp}}
- Generator version: {{generatorVersion}}
- Build package: {{generatorClass}}
{{#infoUrl}}
For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
{{/infoUrl}}

## Requirements.

Python {{{generatorLanguageVersion}}}

## Installation & Usage
### pip install

If the python package is hosted on a repository, you can install directly using:

```sh
pip install git+https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}}.git
```
(you may need to run `pip` with root permission: `sudo pip install git+https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}}.git`)

Then import the package:
```python
import {{{packageName}}}
```

### Setuptools

Install via [Setuptools](http://pypi.python.org/pypi/setuptools).

```sh
python setup.py install --user
```
(or `sudo python setup.py install` to install the package for all users)

Then import the package:
```python
import {{{packageName}}}
```

### Tests

Execute `pytest` to run the tests.

## Getting Started

Please follow the [installation procedure](#installation--usage) and then run the following:

{{> common_README }}
50 changes: 50 additions & 0 deletions openapi/templates/README_onlypackage.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# {{{projectName}}}
{{#appDescription}}
{{{.}}}
{{/appDescription}}

The `{{packageName}}` package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: {{appVersion}}
- Package version: {{packageVersion}}
{{^hideGenerationTimestamp}}
- Build date: {{generatedDate}}
{{/hideGenerationTimestamp}}
- Generator version: {{generatorVersion}}
- Build package: {{generatorClass}}
{{#infoUrl}}
For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
{{/infoUrl}}

## Requirements.

Python {{{generatorLanguageVersion}}}

## Installation & Usage

This python library package is generated without supporting files like setup.py or requirements files

To be able to use it, you will need these dependencies in your own package that uses this library:

* urllib3 >= 1.25.3, < 3.0.0
* python-dateutil >= 2.8.2
{{#asyncio}}
* aiohttp >= 3.8.4
* aiohttp-retry >= 2.8.3
{{/asyncio}}
{{#tornado}}
* tornado >= 4.2, < 5
{{/tornado}}
{{#hasHttpSignatureMethods}}
* pem >= 19.3.0
* pycryptodome >= 3.9.0
{{/hasHttpSignatureMethods}}
* pydantic >= 2
* typing-extensions >= 4.7.1

## Getting Started

In your own code, to use this library to connect and interact with {{{projectName}}},
you can run the following:

{{> common_README }}
Empty file.
5 changes: 5 additions & 0 deletions openapi/templates/__init__api.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# flake8: noqa

# import apis into api package
{{#apiInfo}}{{#apis}}from {{apiPackage}}.{{classFilename}} import {{classname}}
{{/apis}}{{/apiInfo}}
11 changes: 11 additions & 0 deletions openapi/templates/__init__model.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# coding: utf-8

# flake8: noqa
{{>partial_header}}

# import models into model package
{{#models}}
{{#model}}
from {{modelPackage}}.{{classFilename}} import {{classname}}
{{/model}}
{{/models}}
35 changes: 35 additions & 0 deletions openapi/templates/__init__package.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# coding: utf-8

# flake8: noqa

{{>partial_header}}

__version__ = "{{packageVersion}}"

# import apis into sdk package
{{#apiInfo}}{{#apis}}from {{apiPackage}}.{{classFilename}} import {{classname}}
{{/apis}}{{/apiInfo}}
# import ApiClient
from {{packageName}}.api_response import ApiResponse
from {{packageName}}.api_client import ApiClient
from {{packageName}}.configuration import Configuration
from {{packageName}}.exceptions import OpenApiException
from {{packageName}}.exceptions import ApiTypeError
from {{packageName}}.exceptions import ApiValueError
from {{packageName}}.exceptions import ApiKeyError
from {{packageName}}.exceptions import ApiAttributeError
from {{packageName}}.exceptions import ApiException
{{#hasHttpSignatureMethods}}
from {{packageName}}.signing import HttpSigningConfiguration
{{/hasHttpSignatureMethods}}

# import models into sdk package
{{#models}}
{{#model}}
from {{modelPackage}}.{{classFilename}} import {{classname}}
{{/model}}
{{/models}}
{{#recursionLimit}}

__import__('sys').setrecursionlimit({{{.}}})
{{/recursionLimit}}
Loading