Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f72d990
Regens petstore with 1 new route with 3 verbs
spacether Oct 17, 2023
e14e75a
Stores path item parameters
spacether Oct 17, 2023
32d0ea5
Gens path item param in python
spacether Oct 17, 2023
c06a375
Adds missing init file in path item parameters folder
spacether Oct 18, 2023
a84e09d
Moves path item param generation beforeoperation generation
spacether Oct 18, 2023
731f519
Adds pathItemParameters as input in fromOperation
spacether Oct 18, 2023
36aa068
Adds pathItemParams to operation typeddicts
spacether Oct 18, 2023
50a0d39
Fixes path parameter schema types
spacether Oct 18, 2023
924236b
Uses enum in common param
spacether Oct 18, 2023
ba3e16a
Stores path item parameters in a list
spacether Oct 20, 2023
bcfa830
Adds code to use path item parameters in endpoints
spacether Oct 20, 2023
b602df5
Fixes templates
spacether Oct 20, 2023
539c6fd
Refactors parameter schema names, creates ParameterCollection to hold…
spacether Oct 20, 2023
624cd64
Removes queryParams
spacether Oct 20, 2023
c9f5ee9
Removes headerParams
spacether Oct 20, 2023
f6de99d
Removes cookieParams
spacether Oct 20, 2023
25e13f1
Replaces pathItemParameters with collection
spacether Oct 20, 2023
1425105
Removes pathItemPathParams
spacether Oct 20, 2023
42e08e8
Removes pathItemQueryParams
spacether Oct 20, 2023
0eb86f6
Removes pathItemHeaderParams
spacether Oct 20, 2023
8bcef0a
Removes pathItemCookieParams
spacether Oct 20, 2023
3bd0618
Samples regen
spacether Oct 20, 2023
c73b15e
Fixes bug where common parameter had incorrect path
spacether Oct 20, 2023
ca6b9e6
Adds python tests of 3 routes containing pathItem parameters, one whe…
spacether Oct 20, 2023
d57f4f3
Updates endpoint docs
spacether Oct 20, 2023
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions samples/client/petstore/python/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,14 @@ docs/components/security_schemes/security_scheme_open_id_connect_test.md
docs/components/security_schemes/security_scheme_petstore_auth.md
docs/paths/another_fake_dummy/patch.md
docs/paths/another_fake_dummy/patch/responses/response_200/content/application_json/schema.md
docs/paths/common_param_sub_dir/delete.md
docs/paths/common_param_sub_dir/delete/parameters/parameter_0/schema.md
docs/paths/common_param_sub_dir/delete/parameters/parameter_1/schema.md
docs/paths/common_param_sub_dir/get.md
docs/paths/common_param_sub_dir/get/parameters/parameter_0/schema.md
docs/paths/common_param_sub_dir/parameters/parameter_0/schema.md
docs/paths/common_param_sub_dir/post.md
docs/paths/common_param_sub_dir/post/parameters/parameter_0/schema.md
docs/paths/fake/delete.md
docs/paths/fake/delete/parameters/parameter_0/schema.md
docs/paths/fake/delete/parameters/parameter_1/schema.md
Expand Down Expand Up @@ -407,6 +415,7 @@ src/petstore_api/apis/__init__.py
src/petstore_api/apis/path_to_api.py
src/petstore_api/apis/paths/__init__.py
src/petstore_api/apis/paths/another_fake_dummy.py
src/petstore_api/apis/paths/common_param_sub_dir.py
src/petstore_api/apis/paths/fake.py
src/petstore_api/apis/paths/fake_additional_properties_with_array_of_enums.py
src/petstore_api/apis/paths/fake_body_with_file_schema.py
Expand Down Expand Up @@ -706,6 +715,39 @@ src/petstore_api/paths/another_fake_dummy/patch/responses/response_200/__init__.
src/petstore_api/paths/another_fake_dummy/patch/responses/response_200/content/__init__.py
src/petstore_api/paths/another_fake_dummy/patch/responses/response_200/content/application_json/__init__.py
src/petstore_api/paths/another_fake_dummy/patch/responses/response_200/content/application_json/schema.py
src/petstore_api/paths/common_param_sub_dir/__init__.py
src/petstore_api/paths/common_param_sub_dir/delete/__init__.py
src/petstore_api/paths/common_param_sub_dir/delete/header_parameters.py
src/petstore_api/paths/common_param_sub_dir/delete/operation.py
src/petstore_api/paths/common_param_sub_dir/delete/parameters/__init__.py
src/petstore_api/paths/common_param_sub_dir/delete/parameters/parameter_0/__init__.py
src/petstore_api/paths/common_param_sub_dir/delete/parameters/parameter_0/schema.py
src/petstore_api/paths/common_param_sub_dir/delete/parameters/parameter_1/__init__.py
src/petstore_api/paths/common_param_sub_dir/delete/parameters/parameter_1/schema.py
src/petstore_api/paths/common_param_sub_dir/delete/path_parameters.py
src/petstore_api/paths/common_param_sub_dir/delete/responses/__init__.py
src/petstore_api/paths/common_param_sub_dir/delete/responses/response_200/__init__.py
src/petstore_api/paths/common_param_sub_dir/get/__init__.py
src/petstore_api/paths/common_param_sub_dir/get/operation.py
src/petstore_api/paths/common_param_sub_dir/get/parameters/__init__.py
src/petstore_api/paths/common_param_sub_dir/get/parameters/parameter_0/__init__.py
src/petstore_api/paths/common_param_sub_dir/get/parameters/parameter_0/schema.py
src/petstore_api/paths/common_param_sub_dir/get/path_parameters.py
src/petstore_api/paths/common_param_sub_dir/get/query_parameters.py
src/petstore_api/paths/common_param_sub_dir/get/responses/__init__.py
src/petstore_api/paths/common_param_sub_dir/get/responses/response_200/__init__.py
src/petstore_api/paths/common_param_sub_dir/parameters/__init__.py
src/petstore_api/paths/common_param_sub_dir/parameters/parameter_0/__init__.py
src/petstore_api/paths/common_param_sub_dir/parameters/parameter_0/schema.py
src/petstore_api/paths/common_param_sub_dir/post/__init__.py
src/petstore_api/paths/common_param_sub_dir/post/header_parameters.py
src/petstore_api/paths/common_param_sub_dir/post/operation.py
src/petstore_api/paths/common_param_sub_dir/post/parameters/__init__.py
src/petstore_api/paths/common_param_sub_dir/post/parameters/parameter_0/__init__.py
src/petstore_api/paths/common_param_sub_dir/post/parameters/parameter_0/schema.py
src/petstore_api/paths/common_param_sub_dir/post/path_parameters.py
src/petstore_api/paths/common_param_sub_dir/post/responses/__init__.py
src/petstore_api/paths/common_param_sub_dir/post/responses/response_200/__init__.py
src/petstore_api/paths/fake/__init__.py
src/petstore_api/paths/fake/delete/__init__.py
src/petstore_api/paths/fake/delete/header_parameters.py
Expand Down Expand Up @@ -1610,8 +1652,15 @@ test/test_paths/__init__.py
test/test_paths/__init__.py
test/test_paths/__init__.py
test/test_paths/__init__.py
test/test_paths/__init__.py
test/test_paths/__init__.py
test/test_paths/__init__.py
test/test_paths/test_another_fake_dummy/__init__.py
test/test_paths/test_another_fake_dummy/test_patch.py
test/test_paths/test_common_param_sub_dir/__init__.py
test/test_paths/test_common_param_sub_dir/test_delete.py
test/test_paths/test_common_param_sub_dir/test_get.py
test/test_paths/test_common_param_sub_dir/test_post.py
test/test_paths/test_fake/__init__.py
test/test_paths/test_fake/test_delete.py
test/test_paths/test_fake/test_get.py
Expand Down
3 changes: 3 additions & 0 deletions samples/client/petstore/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ HTTP request | Method | Description
------------ | ------ | -------------
/ **get** | [FakeApi](docs/apis/tags/fake_api.md).[slash_route](docs/paths/solidus/get.md) | slash route
/another-fake/dummy **patch** | [AnotherFakeApi](docs/apis/tags/another_fake_api.md).[call_123_test__special_tags](docs/paths/another_fake_dummy/patch.md) | To test special tags
/commonParam/{subDir}/ **delete** | [FakeApi](docs/apis/tags/fake_api.md).[delete_common_param](docs/paths/common_param_sub_dir/delete.md) |
/commonParam/{subDir}/ **get** | [FakeApi](docs/apis/tags/fake_api.md).[get_common_param](docs/paths/common_param_sub_dir/get.md) |
/commonParam/{subDir}/ **post** | [FakeApi](docs/apis/tags/fake_api.md).[post_common_param](docs/paths/common_param_sub_dir/post.md) |
/fake **delete** | [FakeApi](docs/apis/tags/fake_api.md).[group_parameters](docs/paths/fake/delete.md) | Fake endpoint to test group parameters (optional)
/fake **get** | [FakeApi](docs/apis/tags/fake_api.md).[enum_parameters](docs/paths/fake/get.md) | To test enum parameters
/fake **patch** | [FakeApi](docs/apis/tags/fake_api.md).[client_model](docs/paths/fake/patch.md) | To test \"client\" model
Expand Down
3 changes: 3 additions & 0 deletions samples/client/petstore/python/docs/apis/tags/fake_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ Method | Description
[**client_model**](../../paths/fake/patch.md) | To test \"client\" model
[**composed_one_of_different_types**](../../paths/fake_refs_composed_one_of_number_with_validations/post.md) |
[**delete_coffee**](../../paths/fake_delete_coffee_id/delete.md) | Delete coffee
[**delete_common_param**](../../paths/common_param_sub_dir/delete.md) |
[**endpoint_parameters**](../../paths/fake/post.md) | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
[**enum_parameters**](../../paths/fake/get.md) | To test enum parameters
[**fake_health_get**](../../paths/fake_health/get.md) | Health check endpoint
[**get_common_param**](../../paths/common_param_sub_dir/get.md) |
[**group_parameters**](../../paths/fake/delete.md) | Fake endpoint to test group parameters (optional)
[**inline_additional_properties**](../../paths/fake_inline_additional_properties/post.md) | test inline additionalProperties
[**inline_composition**](../../paths/fake_inline_composition/post.md) | testing composed schemas at inline locations
Expand All @@ -36,6 +38,7 @@ Method | Description
[**object_in_query**](../../paths/fake_obj_in_query/get.md) | user list
[**object_model_with_ref_props**](../../paths/fake_refs_object_model_with_ref_props/post.md) |
[**parameter_collisions**](../../paths/fake_parameter_collisions1_abab_self_ab/post.md) | parameter collision case
[**post_common_param**](../../paths/common_param_sub_dir/post.md) |
[**query_param_with_json_content_type**](../../paths/fake_query_param_with_json_content_type/get.md) | query param with json content-type
[**query_parameter_collection_format**](../../paths/fake_test_query_paramters/put.md) |
[**redirection**](../../paths/fake_redirection/get.md) | operation with redirection responses
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
petstore_api.paths.common_param_sub_dir.operation
# Operation Method Name

| Method Name | Api Class | Notes |
| ----------- | --------- | ----- |
| delete_common_param | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake |
| delete | ApiForDelete | This api is only for this endpoint |
| delete | CommonParamSubDir | This api is only for path=/commonParam/{subDir}/ |

## Table of Contents
- [General Info](#general-info)
- [Arguments](#arguments)
- [Return Types](#return-types)
- [Servers](#servers)
- [Code Sample](#code-sample)

## General Info
| Field | Value |
| ----- | ----- |
| Description | common param is overwritten |
| Path | "/commonParam/{subDir}/" |
| HTTP Method | delete |

## Arguments

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
[header_params](#header_params) | [HeaderParametersDictInput](#headerparameters-headerparametersdictinput), [HeaderParametersDict](#headerparameters-headerparametersdict) | |
[path_params](#path_params) | [PathParametersDictInput](#pathparameters-pathparametersdictinput), [PathParametersDict](#pathparameters-pathparametersdict) | |
server_index | typing.Optional[int] | default is None | Allows one to select a different [server](#servers). If not None, must be one of [0, 1, 2]
stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file
timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client
skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_response.ApiResponseWithoutDeserialization will be returned
### header_params
### HeaderParameters
```
type: schemas.Schema
```

#### validate method
Input Type | Return Type | Notes
------------ | ------------- | -------------
[HeaderParametersDictInput](#headerparameters-headerparametersdictinput), [HeaderParametersDict](#headerparameters-headerparametersdict) | [HeaderParametersDict](#headerparameters-headerparametersdict) |

#### HeaderParameters HeaderParametersDictInput
```
type: typing.TypedDict
```
Key | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**someHeader** | str | | [optional]

#### HeaderParameters HeaderParametersDict
```
base class: schemas.immutabledict[str, str]

```
##### __new__ method
Keyword Argument | Type | Description | Notes
---------------- | ---- | ----------- | -----
**someHeader** | str, schemas.Unset | | [optional]

##### properties
Property | Type | Description | Notes
-------- | ---- | ----------- | -----
**someHeader** | str, schemas.Unset | | [optional]

##### methods
Method | Input Type | Return Type | Notes
------ | ---------- | ----------- | ------
from_dict_ | [HeaderParametersDictInput](#headerparameters-headerparametersdictinput), [HeaderParametersDict](#headerparameters-headerparametersdict) | [HeaderParametersDict](#headerparameters-headerparametersdict) | a constructor
### path_params
### PathParameters
```
type: schemas.Schema
```

#### validate method
Input Type | Return Type | Notes
------------ | ------------- | -------------
[PathParametersDictInput](#pathparameters-pathparametersdictinput), [PathParametersDict](#pathparameters-pathparametersdict) | [PathParametersDict](#pathparameters-pathparametersdict) |

#### PathParameters PathParametersDictInput
```
type: typing.TypedDict
```
Key | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**subDir** | typing.Literal["c", "d"] | |

#### PathParameters PathParametersDict
```
base class: schemas.immutabledict[str, typing.Literal["c", "d"]]

```
##### __new__ method
Keyword Argument | Type | Description | Notes
---------------- | ---- | ----------- | -----
**subDir** | typing.Literal["c", "d"] | |

##### properties
Property | Type | Description | Notes
-------- | ---- | ----------- | -----
**subDir** | typing.Literal["c", "d"] | |

##### methods
Method | Input Type | Return Type | Notes
------ | ---------- | ----------- | ------
from_dict_ | [PathParametersDictInput](#pathparameters-pathparametersdictinput), [PathParametersDict](#pathparameters-pathparametersdict) | [PathParametersDict](#pathparameters-pathparametersdict) | a constructor

## Return Types

HTTP Status Code | Class | Description
------------- | ------------- | -------------
n/a | api_response.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned
200 | [SuccessDescriptionOnly.ApiResponse](../../components/responses/response_success_description_only.md#apiresponse) | Success

## Servers

Set the available servers by defining your used servers in ApiConfiguration.server_info
Then select your server by setting a server index in ApiConfiguration.server_index_info or by
passing server_index in to the endpoint method.
- these servers are the general api servers
- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2

server_index | Class | Description
------------ | ----- | ------------
0 | [Server0](../../servers/server_0.md) | petstore server
1 | [Server1](../../servers/server_1.md) | The local server
2 | [Server2](../../servers/server_2.md) | staging server with no variables

## Code Sample

```python
import petstore_api
from petstore_api.configurations import api_configuration
from petstore_api.apis.tags import fake_api
from petstore_api.paths.common_param_sub_dir.delete import operation
from pprint import pprint
used_configuration = api_configuration.ApiConfiguration(
)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(used_configuration) as api_client:
# Create an instance of the API class
api_instance = fake_api.FakeApi(api_client)

# example passing only required values which don't have defaults set
path_params: operation.PathParametersDictInput = {
'subDir': "c",
}
header_params: operation.HeaderParametersDictInput = {
}
try:
api_response = api_instance.delete_common_param(
path_params=path_params,
header_params=header_params,
)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->delete_common_param: %s\n" % e)

# example passing only optional values
path_params = {
'subDir': "c",
}
header_params: operation.HeaderParametersDictInput = {
'someHeader': "someHeader_example",
}
try:
api_response = api_instance.delete_common_param(
path_params=path_params,
header_params=header_params,
)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->delete_common_param: %s\n" % e)
```

[[Back to top]](#top)
[[Back to FakeApi API]](../../apis/tags/fake_api.md)
[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md)
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Schema
petstore_api.paths.common_param_sub_dir.delete.parameters.parameter_0.schema
```
type: schemas.Schema
```

## validate method
Input Type | Return Type | Notes
------------ | ------------- | -------------
str | str |
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Schema
petstore_api.paths.common_param_sub_dir.delete.parameters.parameter_1.schema
```
type: schemas.Schema
```

## validate method
Input Type | Return Type | Notes
------------ | ------------- | -------------
typing.Literal["c", "d"] | typing.Literal["c", "d"] | must be one of ["c", "d"]
Loading