Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Commit a79ef05

Browse files
committed
Fixes petstore tests
1 parent ff5db88 commit a79ef05

86 files changed

Lines changed: 99 additions & 62 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

modules/openapi-json-schema-generator/src/main/resources/python/api_test.handlebars

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ class Test{{operationIdSnakeCase}}(ApiTestMixin, unittest.TestCase):
3636
response_status = {{code}}
3737
{{#if content}}
3838
{{#each content}}
39-
response_body_schema = {{httpMethod}}.response_for_{{code}}.BodySchemas.{{#if schema.nameInSnakeCase}}{{schema.name}}{{else}}{{schema.baseName}}{{/if}}
39+
{{#if schema}}
40+
response_body_schema = {{httpMethod}}.response_for_{{#if ../isDefault}}default{{else}}{{code}}{{/if}}.BodySchemas.{{#if schema.nameInSnakeCase}}{{schema.name}}{{else}}{{schema.baseName}}{{/if}}
41+
{{/if}}
4042

4143
{{#if this.testCases}}
4244
{{#each testCases}}

samples/openapi3/client/petstore/python/docs/apis/tags/DefaultApi.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ Method | HTTP request | Description
1818
```python
1919
import petstore_api
2020
from petstore_api.apis.tags import default_api
21-
from petstore_api.model.foo import Foo
2221
from pprint import pprint
2322
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
2423
# See configuration.py for a list of all supported configuration parameters.

samples/openapi3/client/petstore/python/docs/apis/tags/FakeApi.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,7 +1240,6 @@ Health check endpoint
12401240
```python
12411241
import petstore_api
12421242
from petstore_api.apis.tags import fake_api
1243-
from petstore_api.model.health_check_result import HealthCheckResult
12441243
from pprint import pprint
12451244
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
12461245
# See configuration.py for a list of all supported configuration parameters.
@@ -3304,7 +3303,6 @@ uploads a file using multipart/form-data
33043303
```python
33053304
import petstore_api
33063305
from petstore_api.apis.tags import fake_api
3307-
from petstore_api.model.api_response import ApiResponse
33083306
from pprint import pprint
33093307
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
33103308
# See configuration.py for a list of all supported configuration parameters.
@@ -3395,7 +3393,6 @@ uploads files using multipart/form-data
33953393
```python
33963394
import petstore_api
33973395
from petstore_api.apis.tags import fake_api
3398-
from petstore_api.model.api_response import ApiResponse
33993396
from pprint import pprint
34003397
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
34013398
# See configuration.py for a list of all supported configuration parameters.

samples/openapi3/client/petstore/python/docs/apis/tags/PetApi.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,6 @@ Multiple status values can be provided with comma separated strings
329329
```python
330330
import petstore_api
331331
from petstore_api.apis.tags import pet_api
332-
from petstore_api.model.pet import Pet
333332
from pprint import pprint
334333
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
335334
# See configuration.py for a list of all supported configuration parameters.
@@ -523,7 +522,6 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
523522
```python
524523
import petstore_api
525524
from petstore_api.apis.tags import pet_api
526-
from petstore_api.model.pet import Pet
527525
from pprint import pprint
528526
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
529527
# See configuration.py for a list of all supported configuration parameters.
@@ -717,7 +715,6 @@ Returns a single pet
717715
```python
718716
import petstore_api
719717
from petstore_api.apis.tags import pet_api
720-
from petstore_api.model.pet import Pet
721718
from pprint import pprint
722719
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
723720
# See configuration.py for a list of all supported configuration parameters.
@@ -1144,7 +1141,6 @@ uploads an image (required)
11441141
```python
11451142
import petstore_api
11461143
from petstore_api.apis.tags import pet_api
1147-
from petstore_api.model.api_response import ApiResponse
11481144
from pprint import pprint
11491145
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
11501146
# See configuration.py for a list of all supported configuration parameters.
@@ -1278,7 +1274,6 @@ uploads an image
12781274
```python
12791275
import petstore_api
12801276
from petstore_api.apis.tags import pet_api
1281-
from petstore_api.model.api_response import ApiResponse
12821277
from pprint import pprint
12831278
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
12841279
# See configuration.py for a list of all supported configuration parameters.

samples/openapi3/client/petstore/python/docs/apis/tags/StoreApi.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
190190
```python
191191
import petstore_api
192192
from petstore_api.apis.tags import store_api
193-
from petstore_api.model.order import Order
194193
from pprint import pprint
195194
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
196195
# See configuration.py for a list of all supported configuration parameters.

samples/openapi3/client/petstore/python/docs/apis/tags/UserApi.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,6 @@ Get user by user name
389389
```python
390390
import petstore_api
391391
from petstore_api.apis.tags import user_api
392-
from petstore_api.model.user import User
393392
from pprint import pprint
394393
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
395394
# See configuration.py for a list of all supported configuration parameters.

samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch/response_for_200.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
from petstore_api import schemas # noqa: F401
1616

17+
from petstore_api.model.client import Client
18+
1719

1820
class BodySchemas:
1921
# body schemas

samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch/response_for_200.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
from petstore_api import schemas # noqa: F401
1616

17+
from petstore_api.model.client import Client
18+
1719

1820
class BodySchemas:
1921
# body schemas

samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/response_for_200.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
from petstore_api import schemas # noqa: F401
1616

17+
from petstore_api.model.additional_properties_with_array_of_enums import AdditionalPropertiesWithArrayOfEnums
18+
1719

1820
class BodySchemas:
1921
# body schemas

samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch/response_for_200.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
from petstore_api import schemas # noqa: F401
1616

17+
from petstore_api.model.client import Client
18+
1719

1820
class BodySchemas:
1921
# body schemas

0 commit comments

Comments
 (0)