Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python/Java adds escapeUnsafeCharacters method to generators #313

Merged
merged 9 commits into from
Dec 3, 2023
Merged
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion samples/client/openapi_features/security/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ with this_package.ApiClient(used_configuration) as api_client:

# example, this endpoint has no required or optional parameters
try:
# path with no explicit security
''' path with no explicit security
'''
api_response = api_instance.path_with_no_explicit_security()
pprint(api_response)
except this_package.ApiException as e:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ with this_package.ApiClient(used_configuration) as api_client:

# example, this endpoint has no required or optional parameters
try:
# path with no explicit security
''' path with no explicit security
'''
api_response = api_instance.path_with_no_explicit_security()
pprint(api_response)
except this_package.ApiException as e:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ with this_package.ApiClient(used_configuration) as api_client:

# example, this endpoint has no required or optional parameters
try:
# path with one explicit security
''' path with one explicit security
'''
api_response = api_instance.path_with_one_explicit_security()
pprint(api_response)
except this_package.ApiException as e:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ with this_package.ApiClient(used_configuration) as api_client:

# example, this endpoint has no required or optional parameters
try:
# path with security from root
''' path with security from root
'''
api_response = api_instance.path_with_security_from_root()
pprint(api_response)
except this_package.ApiException as e:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ with this_package.ApiClient(used_configuration) as api_client:

# example, this endpoint has no required or optional parameters
try:
# path with two explicit security
''' path with two explicit security
'''
api_response = api_instance.path_with_two_explicit_security()
pprint(api_response)
except this_package.ApiException as e:
Expand Down
4 changes: 2 additions & 2 deletions samples/client/petstore/java/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: " \

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

Expand Down Expand Up @@ -182,7 +182,7 @@ allowed input and output types.
| [Cat.Cat1](docs/components/schemas/Cat.md#cat1) | |
| [Category.Category1](docs/components/schemas/Category.md#category1) | |
| [ChildCat.ChildCat1](docs/components/schemas/ChildCat.md#childcat1) | |
| [ClassModel.ClassModel1](docs/components/schemas/ClassModel.md#classmodel1) | Model for testing model with \"_class\" property |
| [ClassModel.ClassModel1](docs/components/schemas/ClassModel.md#classmodel1) | Model for testing model with "_class" property |
| [Client.Client1](docs/components/schemas/Client.md#client1) | |
| [ComplexQuadrilateral.ComplexQuadrilateral1](docs/components/schemas/ComplexQuadrilateral.md#complexquadrilateral1) | |
| [ComposedAnyOfDifferentTypesNoValidations.ComposedAnyOfDifferentTypesNoValidations1](docs/components/schemas/ComposedAnyOfDifferentTypesNoValidations.md#composedanyofdifferenttypesnovalidations1) | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ type: Map<String, Object>
| **small_Snake** | String | | [optional] |
| **Capital_Snake** | String | | [optional] |
| **SCA_ETH_Flow_Points** | String | | [optional] |
| **ATT_NAME** | String | Name of the pet | [optional] |
| **ATT_NAME** | String | Name of the pet
| [optional] |
| **anyStringName** | Object | any string name can be used but the value must be the correct type | [optional] |

## ATTNAME
Expand All @@ -70,7 +71,8 @@ extends StringJsonSchema
A schema class that validates payloads

## Description
Name of the pet
Name of the pet


| Methods Inherited from class org.openapijsonschematools.client.schemas.StringJsonSchema |
| ------------------------------------------------------------------ |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ extends JsonSchema
A schema class that validates payloads

## Description
Model for testing model with \&quot;_class\&quot; property
Model for testing model with &quot;_class&quot; property
### Field Summary
| Modifier and Type | Field and Description |
| ----------------- | ---------------------- |
Expand Down
15 changes: 10 additions & 5 deletions samples/client/petstore/python/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# petstore-api
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: " \

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

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

# example, this endpoint has no required or optional parameters
try:
# slash route
''' slash route
'''
api_response = api_instance.slash_route()
pprint(api_response)
except petstore_api.ApiException as e:
Expand Down Expand Up @@ -177,8 +178,12 @@ HTTP request | Method | Description
/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 \&quot;client\&quot; model
/fake **post** | [FakeApi](docs/apis/tags/fake_api.md).[endpoint_parameters](docs/paths/fake/post.md) | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
/fake **patch** | [FakeApi](docs/apis/tags/fake_api.md).[client_model](docs/paths/fake/patch.md) | To test &quot;client&quot; model
/fake **post** | [FakeApi](docs/apis/tags/fake_api.md).[endpoint_parameters](docs/paths/fake/post.md) | Fake endpoint for testing various parameters
假端點
偽のエンドポイント
가짜 엔드 포인트

/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
/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) |
/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) |
Expand Down Expand Up @@ -266,7 +271,7 @@ Class | Description
[Cat](docs/components/schema/cat.md) |
[Category](docs/components/schema/category.md) |
[ChildCat](docs/components/schema/child_cat.md) |
[ClassModel](docs/components/schema/class_model.md) | Model for testing model with \&quot;_class\&quot; property
[ClassModel](docs/components/schema/class_model.md) | Model for testing model with &quot;_class&quot; property
[Client](docs/components/schema/client.md) |
[ComplexQuadrilateral](docs/components/schema/complex_quadrilateral.md) |
[ComposedAnyOfDifferentTypesNoValidations](docs/components/schema/composed_any_of_different_types_no_validations.md) |
Expand Down
8 changes: 6 additions & 2 deletions samples/client/petstore/python/docs/apis/tags/fake_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@ Method | Description
[**body_with_query_params**](../../paths/fake_body_with_query_params/put.md) |
[**boolean**](../../paths/fake_refs_boolean/post.md) |
[**case_sensitive_params**](../../paths/fake_case_sensitive_params/put.md) |
[**client_model**](../../paths/fake/patch.md) | To test \&quot;client\&quot; model
[**client_model**](../../paths/fake/patch.md) | To test &quot;client&quot; 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 假端點 偽のエンドポイント 가짜 엔드 포인트
[**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) |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ Key | Type | Description | Notes
**small_Snake** | str | | [optional]
**Capital_Snake** | str | | [optional]
**SCA_ETH_Flow_Points** | str | | [optional]
**ATT_NAME** | str | Name of the pet | [optional]
**ATT_NAME** | str | Name of the pet
| [optional]
**any_string_name** | dict, schemas.immutabledict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.FileIO | any string name can be used but the value must be the correct type | [optional]

## CapitalizationDict
Expand All @@ -36,7 +37,8 @@ Keyword Argument | Type | Description | Notes
**small_Snake** | str, schemas.Unset | | [optional]
**Capital_Snake** | str, schemas.Unset | | [optional]
**SCA_ETH_Flow_Points** | str, schemas.Unset | | [optional]
**ATT_NAME** | str, schemas.Unset | Name of the pet | [optional]
**ATT_NAME** | str, schemas.Unset | Name of the pet
| [optional]
**kwargs** | schemas.immutabledict, tuple, float, int, str, bool, None, bytes, schemas.FileIO | any string name can be used but the value must be the correct type | [optional] typed value is accessed with the get_additional_property_ method

### properties
Expand All @@ -47,7 +49,8 @@ Property | Type | Description | Notes
**small_Snake** | str, schemas.Unset | | [optional]
**Capital_Snake** | str, schemas.Unset | | [optional]
**SCA_ETH_Flow_Points** | str, schemas.Unset | | [optional]
**ATT_NAME** | str, schemas.Unset | Name of the pet | [optional]
**ATT_NAME** | str, schemas.Unset | Name of the pet
| [optional]

### methods
Method | Input Type | Return Type | Notes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ type: schemas.Schema
```

## Description
Model for testing model with \&quot;_class\&quot; property
Model for testing model with &quot;_class&quot; property

## validate method
Input Type | Return Type | Notes
Expand All @@ -30,7 +30,7 @@ base class: schemas.immutabledict[str, schemas.OUTPUT_BASE_TYPES]
Keyword Argument | Type | Description | Notes
---------------- | ---- | ----------- | -----
**_class** | str, schemas.Unset | | [optional]
**kwargs** | schemas.immutabledict, tuple, float, int, str, bool, None, bytes, schemas.FileIO | any string name can be used but the value must be the correct type Model for testing model with \&quot;_class\&quot; property | [optional] typed value is accessed with the get_additional_property_ method
**kwargs** | schemas.immutabledict, tuple, float, int, str, bool, None, bytes, schemas.FileIO | any string name can be used but the value must be the correct type Model for testing model with &quot;_class&quot; property | [optional] typed value is accessed with the get_additional_property_ method

### properties
Property | Type | Description | Notes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ with petstore_api.ApiClient(used_configuration) as api_client:
"client": "client_example",
})
try:
# To test special tags
''' To test special tags
'''
api_response = api_instance.call_123_test__special_tags(
body=body,
)
Expand Down
6 changes: 4 additions & 2 deletions samples/client/petstore/python/docs/paths/fake/delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ with petstore_api.ApiClient(used_configuration) as api_client:
'required_boolean_group': "true",
}
try:
# Fake endpoint to test group parameters (optional)
''' Fake endpoint to test group parameters (optional)
'''
api_response = api_instance.group_parameters(
query_params=query_params,
header_params=header_params,
Expand All @@ -214,7 +215,8 @@ with petstore_api.ApiClient(used_configuration) as api_client:
'boolean_group': "true",
}
try:
# Fake endpoint to test group parameters (optional)
''' Fake endpoint to test group parameters (optional)
'''
api_response = api_instance.group_parameters(
query_params=query_params,
header_params=header_params,
Expand Down
3 changes: 2 additions & 1 deletion samples/client/petstore/python/docs/paths/fake/get.md
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,8 @@ with petstore_api.ApiClient(used_configuration) as api_client:
"enum_form_string": "-efg",
}
try:
# To test enum parameters
''' To test enum parameters
'''
api_response = api_instance.enum_parameters(
query_params=query_params,
header_params=header_params,
Expand Down
7 changes: 4 additions & 3 deletions samples/client/petstore/python/docs/paths/fake/patch.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ petstore_api.paths.fake.operation
## General Info
| Field | Value |
| ----- | ----- |
| Summary | To test \"client\" model |
| Description | To test \"client\" model |
| Summary | To test &quot;client&quot; model |
| Description | To test &quot;client&quot; model |
| Path | "/fake" |
| HTTP Method | patch |

Expand Down Expand Up @@ -103,7 +103,8 @@ with petstore_api.ApiClient(used_configuration) as api_client:
"client": "client_example",
})
try:
# To test \"client\" model
''' To test &quot;client&quot; model
'''
api_response = api_instance.client_model(
body=body,
)
Expand Down
19 changes: 16 additions & 3 deletions samples/client/petstore/python/docs/paths/fake/post.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,16 @@ petstore_api.paths.fake.operation
## General Info
| Field | Value |
| ----- | ----- |
| Summary | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 |
| Description | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 |
| Summary | Fake endpoint for testing various parameters
假端點
偽のエンドポイント
가짜 엔드 포인트
|
| Description | Fake endpoint for testing various parameters
假端點
偽のエンドポイント
가짜 엔드 포인트
|
| Path | "/fake" |
| HTTP Method | post |

Expand Down Expand Up @@ -214,7 +222,12 @@ with petstore_api.ApiClient(used_configuration) as api_client:
"callback": "callback_example",
}
try:
# Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
''' Fake endpoint for testing various parameters
假端點
偽のエンドポイント
가짜 엔드 포인트

'''
api_response = api_instance.endpoint_parameters(
body=body,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ with petstore_api.ApiClient(used_configuration) as api_client:
],
})
try:
# Additional Properties with Array of Enums
''' Additional Properties with Array of Enums
'''
api_response = api_instance.additional_properties_with_array_of_enums(
body=body,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ petstore_api.paths.fake_body_with_file_schema.operation
## General Info
| Field | Value |
| ----- | ----- |
| Description | For this test, the body for this request much reference a schema named `File`. |
| Description | For this test, the body for this request much reference a schema named &#x60;File&#x60;. |
| Path | "/fake/body-with-file-schema" |
| HTTP Method | put |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ petstore_api.paths.fake_case_sensitive_params.operation
## General Info
| Field | Value |
| ----- | ----- |
| Description | Ensures that original naming is used in endpoint params, that way we on't have collisions |
| Description | Ensures that original naming is used in endpoint params, that way we don&#x27;t have collisions |
| Path | "/fake/case-sensitive-params" |
| HTTP Method | put |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ with petstore_api.ApiClient(used_configuration) as api_client:
"client": "client_example",
})
try:
# To test class name in snake case
''' To test class name in snake case
'''
api_response = api_instance.classname(
body=body,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ with petstore_api.ApiClient(used_configuration) as api_client:
'id': "id_example",
}
try:
# Delete coffee
''' Delete coffee
'''
api_response = api_instance.delete_coffee(
path_params=path_params,
)
Expand Down
3 changes: 2 additions & 1 deletion samples/client/petstore/python/docs/paths/fake_health/get.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ with petstore_api.ApiClient(used_configuration) as api_client:

# example, this endpoint has no required or optional parameters
try:
# Health check endpoint
''' Health check endpoint
'''
api_response = api_instance.fake_health_get()
pprint(api_response)
except petstore_api.ApiException as e:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ with petstore_api.ApiClient(used_configuration) as api_client:
"key": "key_example",
}
try:
# test inline additionalProperties
''' test inline additionalProperties
'''
api_response = api_instance.inline_additional_properties(
body=body,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,8 @@ with petstore_api.ApiClient(used_configuration) as api_client:
}
body = None
try:
# testing composed schemas at inline locations
''' testing composed schemas at inline locations
'''
api_response = api_instance.inline_composition(
query_params=query_params,
body=body,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ with petstore_api.ApiClient(used_configuration) as api_client:
"param2": "param2_example",
}
try:
# test json serialization of form data
''' test json serialization of form data
'''
api_response = api_instance.json_form_data(
body=body,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ with petstore_api.ApiClient(used_configuration) as api_client:
None
])
try:
# json patch
''' json patch
'''
api_response = api_instance.json_patch(
body=body,
)
Expand Down
Loading