Skip to content

Commit 3149e10

Browse files
committed
[Java] Fix content for enum with restclient (#19973)
1 parent e427ec4 commit 3149e10

File tree

26 files changed

+106
-169
lines changed

26 files changed

+106
-169
lines changed

samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Pet.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,10 @@ class Pet
109109
void unsetStatus();
110110
void setStatus(const StatusEnum value);
111111

112-
std::shared_ptr<Object> getMetadata() const;
112+
Object getMetadata() const;
113113
bool metadataIsSet() const;
114114
void unsetMetadata();
115-
void setMetadata(const std::shared_ptr<Object>& value);
115+
void setMetadata(const Object& value);
116116

117117

118118
protected:
@@ -134,7 +134,7 @@ class Pet
134134
StatusEnum m_Status;
135135
bool m_StatusIsSet;
136136

137-
std::shared_ptr<Object> m_Metadata;
137+
Object m_Metadata;
138138
bool m_MetadataIsSet;
139139

140140
};

samples/client/petstore/cpp-restsdk/client/src/model/Pet.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ bool Pet::fromJson(const web::json::value& val)
159159
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(_XPLATSTR("metadata")));
160160
if(!fieldValue.is_null())
161161
{
162-
std::shared_ptr<Object> refVal_setMetadata;
162+
Object refVal_setMetadata;
163163
ok &= ModelBase::fromJson(fieldValue, refVal_setMetadata);
164164
setMetadata(refVal_setMetadata);
165165

@@ -252,7 +252,7 @@ bool Pet::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const util
252252
}
253253
if(multipart->hasContent(utility::conversions::to_string_t(_XPLATSTR("metadata"))))
254254
{
255-
std::shared_ptr<Object> refVal_setMetadata;
255+
Object refVal_setMetadata;
256256
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(_XPLATSTR("metadata"))), refVal_setMetadata );
257257
setMetadata(refVal_setMetadata);
258258
}
@@ -418,13 +418,13 @@ void Pet::unsetStatus()
418418
{
419419
m_StatusIsSet = false;
420420
}
421-
std::shared_ptr<Object> Pet::getMetadata() const
421+
Object Pet::getMetadata() const
422422
{
423423
return m_Metadata;
424424
}
425425

426426

427-
void Pet::setMetadata(const std::shared_ptr<Object>& value)
427+
void Pet::setMetadata(const Object& value)
428428
{
429429
m_Metadata = value;
430430
m_MetadataIsSet = true;

samples/openapi3/client/petstore/python-aiohttp/docs/Type.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33

44
## Enum
55

6-
* `NUMBER_2.0` (value: `2.0`)
6+
* `NUMBER_2_DOT_0` (value: `2.0`)
77

8-
* `NUMBER_1.0` (value: `1.0`)
8+
* `NUMBER_1_DOT_0` (value: `1.0`)
99

10-
* `NUMBER_0.5` (value: `0.5`)
10+
* `NUMBER_0_DOT_5` (value: `0.5`)
1111

12-
* `NUMBER_0.25` (value: `0.25`)
12+
* `NUMBER_0_DOT_25` (value: `0.25`)
1313

1414
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1515

samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/type.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ class Type(int, Enum):
2626
"""
2727
allowed enum values
2828
"""
29-
NUMBER_2.0 = 2.0
30-
NUMBER_1.0 = 1.0
31-
NUMBER_0.5 = 0.5
32-
NUMBER_0.25 = 0.25
29+
NUMBER_2_DOT_0 = 2.0
30+
NUMBER_1_DOT_0 = 1.0
31+
NUMBER_0_DOT_5 = 0.5
32+
NUMBER_0_DOT_25 = 0.25
3333

3434
@classmethod
3535
def from_json(cls, json_str: str) -> Self:

samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Type.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33

44
## Enum
55

6-
* `NUMBER_2.0` (value: `2.0`)
6+
* `NUMBER_2_DOT_0` (value: `2.0`)
77

8-
* `NUMBER_1.0` (value: `1.0`)
8+
* `NUMBER_1_DOT_0` (value: `1.0`)
99

10-
* `NUMBER_0.5` (value: `0.5`)
10+
* `NUMBER_0_DOT_5` (value: `0.5`)
1111

12-
* `NUMBER_0.25` (value: `0.25`)
12+
* `NUMBER_0_DOT_25` (value: `0.25`)
1313

1414
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1515

samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/type.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ class Type(int, Enum):
2929
"""
3030
allowed enum values
3131
"""
32-
NUMBER_2.0 = 2.0
33-
NUMBER_1.0 = 1.0
34-
NUMBER_0.5 = 0.5
35-
NUMBER_0.25 = 0.25
32+
NUMBER_2_DOT_0 = 2.0
33+
NUMBER_1_DOT_0 = 1.0
34+
NUMBER_0_DOT_5 = 0.5
35+
NUMBER_0_DOT_25 = 0.25
3636

3737
@classmethod
3838
def from_json(cls, json_str: str) -> Type:

samples/openapi3/client/petstore/python-pydantic-v1/docs/Type.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33

44
## Enum
55

6-
* `NUMBER_2.0` (value: `2.0`)
6+
* `NUMBER_2_DOT_0` (value: `2.0`)
77

8-
* `NUMBER_1.0` (value: `1.0`)
8+
* `NUMBER_1_DOT_0` (value: `1.0`)
99

10-
* `NUMBER_0.5` (value: `0.5`)
10+
* `NUMBER_0_DOT_5` (value: `0.5`)
1111

12-
* `NUMBER_0.25` (value: `0.25`)
12+
* `NUMBER_0_DOT_25` (value: `0.25`)
1313

1414
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1515

samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/type.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ class Type(int, Enum):
2929
"""
3030
allowed enum values
3131
"""
32-
NUMBER_2.0 = 2.0
33-
NUMBER_1.0 = 1.0
34-
NUMBER_0.5 = 0.5
35-
NUMBER_0.25 = 0.25
32+
NUMBER_2_DOT_0 = 2.0
33+
NUMBER_1_DOT_0 = 1.0
34+
NUMBER_0_DOT_5 = 0.5
35+
NUMBER_0_DOT_25 = 0.25
3636

3737
@classmethod
3838
def from_json(cls, json_str: str) -> Type:

samples/openapi3/client/petstore/python/docs/Type.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33

44
## Enum
55

6-
* `NUMBER_2.0` (value: `2.0`)
6+
* `NUMBER_2_DOT_0` (value: `2.0`)
77

8-
* `NUMBER_1.0` (value: `1.0`)
8+
* `NUMBER_1_DOT_0` (value: `1.0`)
99

10-
* `NUMBER_0.5` (value: `0.5`)
10+
* `NUMBER_0_DOT_5` (value: `0.5`)
1111

12-
* `NUMBER_0.25` (value: `0.25`)
12+
* `NUMBER_0_DOT_25` (value: `0.25`)
1313

1414
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1515

samples/openapi3/client/petstore/python/petstore_api/models/type.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ class Type(int, Enum):
2626
"""
2727
allowed enum values
2828
"""
29-
NUMBER_2.0 = 2.0
30-
NUMBER_1.0 = 1.0
31-
NUMBER_0.5 = 0.5
32-
NUMBER_0.25 = 0.25
29+
NUMBER_2_DOT_0 = 2.0
30+
NUMBER_1_DOT_0 = 1.0
31+
NUMBER_0_DOT_5 = 0.5
32+
NUMBER_0_DOT_25 = 0.25
3333

3434
@classmethod
3535
def from_json(cls, json_str: str) -> Self:

0 commit comments

Comments
 (0)