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

Commit 81848f7

Browse files
authored
Fixes component access issue + path item params bug (#260)
* Fixes component access issue * Moves java code, handles path item params correctly if there are no endpoint params defined * Adds java tests * Samples regenerated
1 parent 3b6652d commit 81848f7

File tree

65 files changed

+6263
-33
lines changed

Some content is hidden

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

65 files changed

+6263
-33
lines changed

samples/client/3_0_3_unit_test/python/.openapi-generator/FILES

-1
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,6 @@ src/unit_test_api/components/schema/uniqueitems_validation.py
770770
src/unit_test_api/components/schema/uri_format.py
771771
src/unit_test_api/components/schema/uri_reference_format.py
772772
src/unit_test_api/components/schema/uri_template_format.py
773-
src/unit_test_api/components/schemas/__init__.py
774773
src/unit_test_api/configurations/__init__.py
775774
src/unit_test_api/configurations/api_configuration.py
776775
src/unit_test_api/configurations/schema_configuration.py

samples/client/3_1_0_json_schema/python/.openapi-generator/FILES

-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ src/json_schema_api/components/schema/object_pattern_properties.py
7979
src/json_schema_api/components/schema/object_property_names.py
8080
src/json_schema_api/components/schema/object_unevaluated_properties_false_with_properties.py
8181
src/json_schema_api/components/schema/string_const_string.py
82-
src/json_schema_api/components/schemas/__init__.py
8382
src/json_schema_api/configurations/__init__.py
8483
src/json_schema_api/configurations/api_configuration.py
8584
src/json_schema_api/configurations/schema_configuration.py

samples/client/3_1_0_unit_test/python/.openapi-generator/FILES

-1
Original file line numberDiff line numberDiff line change
@@ -1158,7 +1158,6 @@ src/unit_test_api/components/schema/uri_format.py
11581158
src/unit_test_api/components/schema/uri_reference_format.py
11591159
src/unit_test_api/components/schema/uri_template_format.py
11601160
src/unit_test_api/components/schema/uuid_format.py
1161-
src/unit_test_api/components/schemas/__init__.py
11621161
src/unit_test_api/configurations/__init__.py
11631162
src/unit_test_api/configurations/api_configuration.py
11641163
src/unit_test_api/configurations/schema_configuration.py

samples/client/openapi_features/nonCompliantUseDiscriminatorIfCompositionFails/python/.openapi-generator/FILES

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ src/this_package/components/schema/__init__.py
2929
src/this_package/components/schema/addition_operator.py
3030
src/this_package/components/schema/operator.py
3131
src/this_package/components/schema/subtraction_operator.py
32-
src/this_package/components/schemas/__init__.py
3332
src/this_package/configurations/__init__.py
3433
src/this_package/configurations/api_configuration.py
3534
src/this_package/configurations/schema_configuration.py

samples/client/openapi_features/security/python/.openapi-generator/FILES

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ src/this_package/apis/paths/path_with_two_explicit_security.py
2929
src/this_package/apis/tag_to_api.py
3030
src/this_package/apis/tags/__init__.py
3131
src/this_package/apis/tags/default_api.py
32-
src/this_package/components/schemas/__init__.py
3332
src/this_package/components/security_schemes/__init__.py
3433
src/this_package/components/security_schemes/security_scheme_api_key.py
3534
src/this_package/components/security_schemes/security_scheme_bearer_test.py

samples/client/petstore/python/.openapi-generator/FILES

-1
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,6 @@ src/petstore_api/components/schema/user.py
692692
src/petstore_api/components/schema/uuid_string.py
693693
src/petstore_api/components/schema/whale.py
694694
src/petstore_api/components/schema/zebra.py
695-
src/petstore_api/components/schemas/__init__.py
696695
src/petstore_api/components/security_schemes/__init__.py
697696
src/petstore_api/components/security_schemes/security_scheme_api_key.py
698697
src/petstore_api/components/security_schemes/security_scheme_api_key_query.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
issue259_sample1.components.security_schemes.security_scheme_basic
2+
# SecurityScheme Basic
3+
4+
## Description
5+
NetHSM supports Basic Authentication.
6+
7+
8+
## Type
9+
security_schemes.SecuritySchemeType.HTTP
10+
11+
## Scheme
12+
security_schemes.HTTPSchemeType.BASIC
13+
14+
## user_id
15+
Type | Notes
16+
---- | ------
17+
str | Set by the developer
18+
19+
## password
20+
Type | Notes
21+
---- | ------
22+
str | Set by the developer
23+
24+
[[Back to top]](#top) [[Back to Component Security Schemes]](../../../README.md#Component-SecuritySchemes) [[Back to README]](../../../README.md)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
issue259_sample1.paths.users_user_id.operation
2+
# Operation Method Name
3+
4+
| Method Name | Api Class | Notes |
5+
| ----------- | --------- | ----- |
6+
| users_user_id_get | [DefaultApi](../../apis/tags/default_api.md) | This api is only for tag=default |
7+
| get | ApiForGet | This api is only for this endpoint |
8+
| get | UsersUserID | This api is only for path=/users/{UserID} |
9+
10+
## Table of Contents
11+
- [General Info](#general-info)
12+
- [Arguments](#arguments)
13+
- [Return Types](#return-types)
14+
- [Servers](#servers)
15+
- [Code Sample](#code-sample)
16+
17+
## General Info
18+
| Field | Value |
19+
| ----- | ----- |
20+
| Description | Get user info: name and role. |
21+
| Path | "/users/{UserID}" |
22+
| HTTP Method | get |
23+
24+
## Arguments
25+
26+
Name | Type | Description | Notes
27+
------------- | ------------- | ------------- | -------------
28+
accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client
29+
server_index | typing.Optional[int] | default is None | Allows one to select a different [server](#servers). If not None, must be one of [0]
30+
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
31+
timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client
32+
skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_response.ApiResponseWithoutDeserialization will be returned
33+
34+
## Return Types
35+
36+
HTTP Status Code | Class | Description
37+
------------- | ------------- | -------------
38+
n/a | api_response.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned
39+
200 | [ResponseFor200.ApiResponse](#responsefor200-apiresponse) |
40+
41+
## ResponseFor200
42+
43+
### ResponseFor200 ApiResponse
44+
Name | Type | Description | Notes
45+
------------- | ------------- | ------------- | -------------
46+
response | urllib3.HTTPResponse | Raw response |
47+
[body](#responsefor200-body) | str | |
48+
headers | Unset | headers were not defined |
49+
50+
### ResponseFor200 Body
51+
Content-Type | Schema
52+
------------ | -------
53+
"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema)
54+
55+
### Body Details
56+
#### ResponseFor200 content ApplicationJson Schema
57+
issue259_sample1.paths.users_user_id.get.responses.response_200.content.application_json.schema
58+
```
59+
type: schemas.Schema
60+
```
61+
62+
##### validate method
63+
Input Type | Return Type | Notes
64+
------------ | ------------- | -------------
65+
str | str |
66+
67+
## Servers
68+
69+
Set the available servers by defining your used servers in ApiConfiguration.server_info
70+
Then select your server by setting a server index in ApiConfiguration.server_index_info or by
71+
passing server_index in to the endpoint method.
72+
- these servers are the general api servers
73+
- defaults to server_index=0, server.url = https://localhost:8443/api/v1
74+
75+
server_index | Class | Description
76+
------------ | ----- | ------------
77+
0 | [Server0](../../servers/server_0.md) |
78+
79+
## Code Sample
80+
81+
```python
82+
import issue259_sample1
83+
from issue259_sample1.configurations import api_configuration
84+
from issue259_sample1.apis.tags import default_api
85+
from pprint import pprint
86+
used_configuration = api_configuration.ApiConfiguration(
87+
)
88+
# Enter a context with an instance of the API client
89+
with issue259_sample1.ApiClient(used_configuration) as api_client:
90+
# Create an instance of the API class
91+
api_instance = default_api.DefaultApi(api_client)
92+
93+
# example, this endpoint has no required or optional parameters
94+
try:
95+
api_response = api_instance.users_user_id_get()
96+
pprint(api_response)
97+
except issue259_sample1.ApiException as e:
98+
print("Exception when calling DefaultApi->users_user_id_get: %s\n" % e)
99+
```
100+
101+
[[Back to top]](#top)
102+
[[Back to DefaultApi API]](../../apis/tags/default_api.md)
103+
[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Schema
2+
issue259_sample1.paths.users_user_id.get.responses.response_200.content.application_json.schema
3+
```
4+
type: schemas.Schema
5+
```
6+
7+
## validate method
8+
Input Type | Return Type | Notes
9+
------------ | ------------- | -------------
10+
str | str |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Schema
2+
issue259_sample1.paths.users_user_id.parameters.parameter_0.schema
3+
```
4+
type: schemas.Schema
5+
```
6+
7+
## validate method
8+
Input Type | Return Type | Notes
9+
------------ | ------------- | -------------
10+
str | str |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# coding: utf-8
2+
3+
# flake8: noqa
4+
5+
"""
6+
NetHSM
7+
No description provided (generated by Openapi JSON Schema Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) # noqa: E501
8+
The version of the OpenAPI document: v1
9+
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
10+
"""
11+
12+
__version__ = "1.0.0"
13+
14+
# import ApiClient
15+
from issue259_sample1.api_client import ApiClient
16+
17+
# import Configuration
18+
from issue259_sample1.configurations.api_configuration import ApiConfiguration
19+
20+
# import exceptions
21+
from issue259_sample1.exceptions import OpenApiException
22+
from issue259_sample1.exceptions import ApiAttributeError
23+
from issue259_sample1.exceptions import ApiTypeError
24+
from issue259_sample1.exceptions import ApiValueError
25+
from issue259_sample1.exceptions import ApiKeyError
26+
from issue259_sample1.exceptions import ApiException

0 commit comments

Comments
 (0)