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

Commit a1c0818

Browse files
authored
Python/Java adds escapeUnsafeCharacters method to generators (#313)
* Java code updated to add escapeUnsafeCharacters to java and python generators * Sample regen * Sample regen to fix readme * Uses unescapedAppDescription in readme * Uses unescaped description in component schema docs * Updates description header in python files * Changes operation summary to not use escaped value * Sample regen to fix operation docs * fixes typo in openapi document
1 parent 8342fef commit a1c0818

430 files changed

Lines changed: 593 additions & 504 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.

samples/client/openapi_features/security/python/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ with this_package.ApiClient(used_configuration) as api_client:
147147

148148
# example, this endpoint has no required or optional parameters
149149
try:
150-
# path with no explicit security
150+
''' path with no explicit security
151+
'''
151152
api_response = api_instance.path_with_no_explicit_security()
152153
pprint(api_response)
153154
except this_package.ApiException as e:

samples/client/openapi_features/security/python/docs/paths/path_with_no_explicit_security/get.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ with this_package.ApiClient(used_configuration) as api_client:
7777

7878
# example, this endpoint has no required or optional parameters
7979
try:
80-
# path with no explicit security
80+
''' path with no explicit security
81+
'''
8182
api_response = api_instance.path_with_no_explicit_security()
8283
pprint(api_response)
8384
except this_package.ApiException as e:

samples/client/openapi_features/security/python/docs/paths/path_with_one_explicit_security/get.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ with this_package.ApiClient(used_configuration) as api_client:
104104

105105
# example, this endpoint has no required or optional parameters
106106
try:
107-
# path with one explicit security
107+
''' path with one explicit security
108+
'''
108109
api_response = api_instance.path_with_one_explicit_security()
109110
pprint(api_response)
110111
except this_package.ApiException as e:

samples/client/openapi_features/security/python/docs/paths/path_with_security_from_root/get.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ with this_package.ApiClient(used_configuration) as api_client:
145145

146146
# example, this endpoint has no required or optional parameters
147147
try:
148-
# path with security from root
148+
''' path with security from root
149+
'''
149150
api_response = api_instance.path_with_security_from_root()
150151
pprint(api_response)
151152
except this_package.ApiException as e:

samples/client/openapi_features/security/python/docs/paths/path_with_two_explicit_security/get.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ with this_package.ApiClient(used_configuration) as api_client:
121121

122122
# example, this endpoint has no required or optional parameters
123123
try:
124-
# path with two explicit security
124+
''' path with two explicit security
125+
'''
125126
api_response = api_instance.path_with_two_explicit_security()
126127
pprint(api_response)
127128
except this_package.ApiException as e:

samples/client/petstore/java/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
2+
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: " \
33

44
This Java package is automatically generated by the [OpenAPI JSON Schema Generator](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) project:
55

@@ -182,7 +182,7 @@ allowed input and output types.
182182
| [Cat.Cat1](docs/components/schemas/Cat.md#cat1) | |
183183
| [Category.Category1](docs/components/schemas/Category.md#category1) | |
184184
| [ChildCat.ChildCat1](docs/components/schemas/ChildCat.md#childcat1) | |
185-
| [ClassModel.ClassModel1](docs/components/schemas/ClassModel.md#classmodel1) | Model for testing model with \"_class\" property |
185+
| [ClassModel.ClassModel1](docs/components/schemas/ClassModel.md#classmodel1) | Model for testing model with "_class" property |
186186
| [Client.Client1](docs/components/schemas/Client.md#client1) | |
187187
| [ComplexQuadrilateral.ComplexQuadrilateral1](docs/components/schemas/ComplexQuadrilateral.md#complexquadrilateral1) | |
188188
| [ComposedAnyOfDifferentTypesNoValidations.ComposedAnyOfDifferentTypesNoValidations1](docs/components/schemas/ComposedAnyOfDifferentTypesNoValidations.md#composedanyofdifferenttypesnovalidations1) | |

samples/client/petstore/java/docs/components/schemas/Capitalization.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ type: Map<String, Object>
6060
| **small_Snake** | String | | [optional] |
6161
| **Capital_Snake** | String | | [optional] |
6262
| **SCA_ETH_Flow_Points** | String | | [optional] |
63-
| **ATT_NAME** | String | Name of the pet | [optional] |
63+
| **ATT_NAME** | String | Name of the pet
64+
| [optional] |
6465
| **anyStringName** | Object | any string name can be used but the value must be the correct type | [optional] |
6566

6667
## ATTNAME
@@ -70,7 +71,8 @@ extends StringJsonSchema
7071
A schema class that validates payloads
7172

7273
## Description
73-
Name of the pet
74+
Name of the pet
75+
7476

7577
| Methods Inherited from class org.openapijsonschematools.client.schemas.StringJsonSchema |
7678
| ------------------------------------------------------------------ |

samples/client/petstore/java/docs/components/schemas/ClassModel.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ extends JsonSchema
1818
A schema class that validates payloads
1919

2020
## Description
21-
Model for testing model with \&quot;_class\&quot; property
21+
Model for testing model with &quot;_class&quot; property
2222
### Field Summary
2323
| Modifier and Type | Field and Description |
2424
| ----------------- | ---------------------- |

samples/client/petstore/python/README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# petstore-api
2-
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
2+
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: " \
33

44
This Python package is automatically generated by the [OpenAPI JSON Schema Generator](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) project:
55

@@ -147,7 +147,8 @@ with petstore_api.ApiClient(used_configuration) as api_client:
147147

148148
# example, this endpoint has no required or optional parameters
149149
try:
150-
# slash route
150+
''' slash route
151+
'''
151152
api_response = api_instance.slash_route()
152153
pprint(api_response)
153154
except petstore_api.ApiException as e:
@@ -177,8 +178,12 @@ HTTP request | Method | Description
177178
/commonParam/{subDir}/ **post** | [FakeApi](docs/apis/tags/fake_api.md).[post_common_param](docs/paths/common_param_sub_dir/post.md) |
178179
/fake **delete** | [FakeApi](docs/apis/tags/fake_api.md).[group_parameters](docs/paths/fake/delete.md) | Fake endpoint to test group parameters (optional)
179180
/fake **get** | [FakeApi](docs/apis/tags/fake_api.md).[enum_parameters](docs/paths/fake/get.md) | To test enum parameters
180-
/fake **patch** | [FakeApi](docs/apis/tags/fake_api.md).[client_model](docs/paths/fake/patch.md) | To test \&quot;client\&quot; model
181-
/fake **post** | [FakeApi](docs/apis/tags/fake_api.md).[endpoint_parameters](docs/paths/fake/post.md) | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
181+
/fake **patch** | [FakeApi](docs/apis/tags/fake_api.md).[client_model](docs/paths/fake/patch.md) | To test &quot;client&quot; model
182+
/fake **post** | [FakeApi](docs/apis/tags/fake_api.md).[endpoint_parameters](docs/paths/fake/post.md) | Fake endpoint for testing various parameters
183+
假端點
184+
偽のエンドポイント
185+
가짜 엔드 포인트
186+
182187
/fake/additional-properties-with-array-of-enums **get** | [FakeApi](docs/apis/tags/fake_api.md).[additional_properties_with_array_of_enums](docs/paths/fake_additional_properties_with_array_of_enums/get.md) | Additional Properties with Array of Enums
183188
/fake/body-with-file-schema **put** | [FakeApi](docs/apis/tags/fake_api.md).[body_with_file_schema](docs/paths/fake_body_with_file_schema/put.md) |
184189
/fake/body-with-query-params **put** | [FakeApi](docs/apis/tags/fake_api.md).[body_with_query_params](docs/paths/fake_body_with_query_params/put.md) |
@@ -266,7 +271,7 @@ Class | Description
266271
[Cat](docs/components/schema/cat.md) |
267272
[Category](docs/components/schema/category.md) |
268273
[ChildCat](docs/components/schema/child_cat.md) |
269-
[ClassModel](docs/components/schema/class_model.md) | Model for testing model with \&quot;_class\&quot; property
274+
[ClassModel](docs/components/schema/class_model.md) | Model for testing model with &quot;_class&quot; property
270275
[Client](docs/components/schema/client.md) |
271276
[ComplexQuadrilateral](docs/components/schema/complex_quadrilateral.md) |
272277
[ComposedAnyOfDifferentTypesNoValidations](docs/components/schema/composed_any_of_different_types_no_validations.md) |

samples/client/petstore/python/docs/apis/tags/fake_api.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,15 @@ Method | Description
1616
[**body_with_query_params**](../../paths/fake_body_with_query_params/put.md) |
1717
[**boolean**](../../paths/fake_refs_boolean/post.md) |
1818
[**case_sensitive_params**](../../paths/fake_case_sensitive_params/put.md) |
19-
[**client_model**](../../paths/fake/patch.md) | To test \&quot;client\&quot; model
19+
[**client_model**](../../paths/fake/patch.md) | To test &quot;client&quot; model
2020
[**composed_one_of_different_types**](../../paths/fake_refs_composed_one_of_number_with_validations/post.md) |
2121
[**delete_coffee**](../../paths/fake_delete_coffee_id/delete.md) | Delete coffee
2222
[**delete_common_param**](../../paths/common_param_sub_dir/delete.md) |
23-
[**endpoint_parameters**](../../paths/fake/post.md) | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
23+
[**endpoint_parameters**](../../paths/fake/post.md) | Fake endpoint for testing various parameters
24+
假端點
25+
偽のエンドポイント
26+
가짜 엔드 포인트
27+
2428
[**enum_parameters**](../../paths/fake/get.md) | To test enum parameters
2529
[**fake_health_get**](../../paths/fake_health/get.md) | Health check endpoint
2630
[**get_common_param**](../../paths/common_param_sub_dir/get.md) |

0 commit comments

Comments
 (0)