| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 4478b62 commit 2fcd3cb
11 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,6 +9,25 @@ | |||
| 9 | 9 | Circular $ref in request body | |
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | + If you believe this was a mistake or this tool is missing a feature you need, please open an issue at https://github.com/openapi-generators/openapi-python-client/issues/new/choose | ||
| 13 | + | ||
| 14 | + ''' | ||
| 15 | + # --- | ||
| 16 | + # name: test_documents_with_errors[invalid-uuid-defaults] | ||
| 17 | + ''' | ||
| 18 | + Generating /test-documents-with-errors | ||
| 19 | + Warning(s) encountered while generating. Client was generated, but some pieces may be missing | ||
| 20 | + | ||
| 21 | + WARNING parsing PUT / within default. Endpoint will not be generated. | ||
| 22 | + | ||
| 23 | + cannot parse parameter of endpoint put_: Invalid UUID value: 3 | ||
| 24 | + | ||
| 25 | + | ||
| 26 | + WARNING parsing POST / within default. Endpoint will not be generated. | ||
| 27 | + | ||
| 28 | + cannot parse parameter of endpoint post_: Invalid UUID value: notauuid | ||
| 29 | + | ||
| 30 | + | ||
| 12 | 31 | If you believe this was a mistake or this tool is missing a feature you need, please open an issue at https://github.com/openapi-generators/openapi-python-client/issues/new/choose | |
| 13 | 32 | ||
| 14 | 33 | ''' | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1714,6 +1714,8 @@ | |||
| 1714 | 1714 | "aCamelDateTime", | |
| 1715 | 1715 | "a_date", | |
| 1716 | 1716 | "a_nullable_date", | |
| 1717 | + "a_uuid", | ||
| 1718 | + "a_nullable_uuid", | ||
| 1717 | 1719 | "required_nullable", | |
| 1718 | 1720 | "required_not_nullable", | |
| 1719 | 1721 | "model", | |
@@ -1784,6 +1786,23 @@ | |||
| 1784 | 1786 | "type": "string", | |
| 1785 | 1787 | "format": "date" | |
| 1786 | 1788 | }, | |
| 1789 | + "a_uuid": { | ||
| 1790 | + "title": "A Uuid", | ||
| 1791 | + "type": "string", | ||
| 1792 | + "format": "uuid" | ||
| 1793 | + }, | ||
| 1794 | + "a_nullable_uuid": { | ||
| 1795 | + "title": "A Nullable Uuid", | ||
| 1796 | + "type": "string", | ||
| 1797 | + "format": "uuid", | ||
| 1798 | + "nullable": true, | ||
| 1799 | + "default": "07EF8B4D-AA09-4FFA-898D-C710796AFF41" | ||
| 1800 | + }, | ||
| 1801 | + "a_not_required_uuid": { | ||
| 1802 | + "title": "A Not Required Uuid", | ||
| 1803 | + "type": "string", | ||
| 1804 | + "format": "uuid" | ||
| 1805 | + }, | ||
| 1787 | 1806 | "1_leading_digit": { | |
| 1788 | 1807 | "title": "Leading Digit", | |
| 1789 | 1808 | "type": "string" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1699,6 +1699,8 @@ info: | |||
| 1699 | 1699 | "aCamelDateTime", | |
| 1700 | 1700 | "a_date", | |
| 1701 | 1701 | "a_nullable_date", | |
| 1702 | + "a_uuid", | ||
| 1703 | + "a_nullable_uuid", | ||
| 1702 | 1704 | "required_nullable", | |
| 1703 | 1705 | "required_not_nullable", | |
| 1704 | 1706 | "model", | |
@@ -1771,6 +1773,29 @@ info: | |||
| 1771 | 1773 | "type": "string", | |
| 1772 | 1774 | "format": "date" | |
| 1773 | 1775 | }, | |
| 1776 | + "a_uuid": { | ||
| 1777 | + "title": "A Uuid", | ||
| 1778 | + "type": "string", | ||
| 1779 | + "format": "uuid" | ||
| 1780 | + }, | ||
| 1781 | + "a_nullable_uuid": { | ||
| 1782 | + "title": "A Nullable Uuid", | ||
| 1783 | + "anyOf": [ | ||
| 1784 | + { | ||
| 1785 | + "type": "string", | ||
| 1786 | + "format": "uuid", | ||
| 1787 | + }, | ||
| 1788 | + { | ||
| 1789 | + "type": "null" | ||
| 1790 | + } | ||
| 1791 | + ], | ||
| 1792 | + "default": "07EF8B4D-AA09-4FFA-898D-C710796AFF41" | ||
| 1793 | + }, | ||
| 1794 | + "a_not_required_uuid": { | ||
| 1795 | + "title": "A Not Required Uuid", | ||
| 1796 | + "type": "string", | ||
| 1797 | + "format": "uuid" | ||
| 1798 | + }, | ||
| 1774 | 1799 | "1_leading_digit": { | |
| 1775 | 1800 | "title": "Leading Digit", | |
| 1776 | 1801 | "type": "string" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,30 @@ | |||
| 1 | + openapi: "3.1.0" | ||
| 2 | + info: | ||
| 3 | + title: "Circular Body Ref" | ||
| 4 | + version: "0.1.0" | ||
| 5 | + paths: | ||
| 6 | + /: | ||
| 7 | + post: | ||
| 8 | + parameters: | ||
| 9 | + - name: id | ||
| 10 | + in: query | ||
| 11 | + required: false | ||
| 12 | + schema: | ||
| 13 | + type: string | ||
| 14 | + format: uuid | ||
| 15 | + default: "notauuid" | ||
| 16 | + responses: | ||
| 17 | + "200": | ||
| 18 | + description: "Successful Response" | ||
| 19 | + put: | ||
| 20 | + parameters: | ||
| 21 | + - name: another_id | ||
| 22 | + in: query | ||
| 23 | + required: false | ||
| 24 | + schema: | ||
| 25 | + type: string | ||
| 26 | + format: uuid | ||
| 27 | + default: 3 | ||
| 28 | + responses: | ||
| 29 | + "200": | ||
| 30 | + description: "Successful Response" | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,6 @@ | |||
| 1 | 1 | import datetime | |
| 2 | 2 | from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast | |
| 3 | + from uuid import UUID | ||
| 3 | 4 | ||
| 4 | 5 | from attrs import define as _attrs_define | |
| 5 | 6 | from dateutil.parser import isoparse | |
@@ -27,6 +28,8 @@ class AModel: | |||
| 27 | 28 | a_camel_date_time (Union[datetime.date, datetime.datetime]): | |
| 28 | 29 | a_date (datetime.date): | |
| 29 | 30 | a_nullable_date (Union[None, datetime.date]): | |
| 31 | + a_uuid (UUID): | ||
| 32 | + a_nullable_uuid (Union[None, UUID]): Default: UUID('07EF8B4D-AA09-4FFA-898D-C710796AFF41'). | ||
| 30 | 33 | required_nullable (Union[None, str]): | |
| 31 | 34 | required_not_nullable (str): | |
| 32 | 35 | one_of_models (Union['FreeFormModel', 'ModelWithUnionProperty', Any]): | |
@@ -37,6 +40,7 @@ class AModel: | |||
| 37 | 40 | an_optional_allof_enum (Union[Unset, AnAllOfEnum]): | |
| 38 | 41 | nested_list_of_enums (Union[Unset, List[List[DifferentEnum]]]): | |
| 39 | 42 | a_not_required_date (Union[Unset, datetime.date]): | |
| 43 | + a_not_required_uuid (Union[Unset, UUID]): | ||
| 40 | 44 | attr_1_leading_digit (Union[Unset, str]): | |
| 41 | 45 | attr_leading_underscore (Union[Unset, str]): | |
| 42 | 46 | not_required_nullable (Union[None, Unset, str]): | |
@@ -51,17 +55,20 @@ class AModel: | |||
| 51 | 55 | a_camel_date_time: Union[datetime.date, datetime.datetime] | |
| 52 | 56 | a_date: datetime.date | |
| 53 | 57 | a_nullable_date: Union[None, datetime.date] | |
| 58 | + a_uuid: UUID | ||
| 54 | 59 | required_nullable: Union[None, str] | |
| 55 | 60 | required_not_nullable: str | |
| 56 | 61 | one_of_models: Union["FreeFormModel", "ModelWithUnionProperty", Any] | |
| 57 | 62 | nullable_one_of_models: Union["FreeFormModel", "ModelWithUnionProperty", None] | |
| 58 | 63 | model: "ModelWithUnionProperty" | |
| 59 | 64 | nullable_model: Union["ModelWithUnionProperty", None] | |
| 60 | 65 | an_allof_enum_with_overridden_default: AnAllOfEnum = AnAllOfEnum.OVERRIDDEN_DEFAULT | |
| 66 | + a_nullable_uuid: Union[None, UUID] = UUID("07EF8B4D-AA09-4FFA-898D-C710796AFF41") | ||
| 61 | 67 | any_value: Union[Unset, Any] = "default" | |
| 62 | 68 | an_optional_allof_enum: Union[Unset, AnAllOfEnum] = UNSET | |
| 63 | 69 | nested_list_of_enums: Union[Unset, List[List[DifferentEnum]]] = UNSET | |
| 64 | 70 | a_not_required_date: Union[Unset, datetime.date] = UNSET | |
| 71 | + a_not_required_uuid: Union[Unset, UUID] = UNSET | ||
| 65 | 72 | attr_1_leading_digit: Union[Unset, str] = UNSET | |
| 66 | 73 | attr_leading_underscore: Union[Unset, str] = UNSET | |
| 67 | 74 | not_required_nullable: Union[None, Unset, str] = UNSET | |
@@ -93,6 +100,14 @@ def to_dict(self) -> Dict[str, Any]: | |||
| 93 | 100 | else: | |
| 94 | 101 | a_nullable_date = self.a_nullable_date | |
| 95 | 102 | ||
| 103 | + a_uuid = str(self.a_uuid) | ||
| 104 | + | ||
| 105 | + a_nullable_uuid: Union[None, str] | ||
| 106 | + if isinstance(self.a_nullable_uuid, UUID): | ||
| 107 | + a_nullable_uuid = str(self.a_nullable_uuid) | ||
| 108 | + else: | ||
| 109 | + a_nullable_uuid = self.a_nullable_uuid | ||
| 110 | + | ||
| 96 | 111 | required_nullable: Union[None, str] | |
| 97 | 112 | required_nullable = self.required_nullable | |
| 98 | 113 | ||
@@ -143,6 +158,10 @@ def to_dict(self) -> Dict[str, Any]: | |||
| 143 | 158 | if not isinstance(self.a_not_required_date, Unset): | |
| 144 | 159 | a_not_required_date = self.a_not_required_date.isoformat() | |
| 145 | 160 | ||
| 161 | + a_not_required_uuid: Union[Unset, str] = UNSET | ||
| 162 | + if not isinstance(self.a_not_required_uuid, Unset): | ||
| 163 | + a_not_required_uuid = str(self.a_not_required_uuid) | ||
| 164 | + | ||
| 146 | 165 | attr_1_leading_digit = self.attr_1_leading_digit | |
| 147 | 166 | ||
| 148 | 167 | attr_leading_underscore = self.attr_leading_underscore | |
@@ -193,6 +212,8 @@ def to_dict(self) -> Dict[str, Any]: | |||
| 193 | 212 | "aCamelDateTime": a_camel_date_time, | |
| 194 | 213 | "a_date": a_date, | |
| 195 | 214 | "a_nullable_date": a_nullable_date, | |
| 215 | + "a_uuid": a_uuid, | ||
| 216 | + "a_nullable_uuid": a_nullable_uuid, | ||
| 196 | 217 | "required_nullable": required_nullable, | |
| 197 | 218 | "required_not_nullable": required_not_nullable, | |
| 198 | 219 | "one_of_models": one_of_models, | |
@@ -209,6 +230,8 @@ def to_dict(self) -> Dict[str, Any]: | |||
| 209 | 230 | field_dict["nested_list_of_enums"] = nested_list_of_enums | |
| 210 | 231 | if a_not_required_date is not UNSET: | |
| 211 | 232 | field_dict["a_not_required_date"] = a_not_required_date | |
| 233 | + if a_not_required_uuid is not UNSET: | ||
| 234 | + field_dict["a_not_required_uuid"] = a_not_required_uuid | ||
| 212 | 235 | if attr_1_leading_digit is not UNSET: | |
| 213 | 236 | field_dict["1_leading_digit"] = attr_1_leading_digit | |
| 214 | 237 | if attr_leading_underscore is not UNSET: | |
@@ -272,6 +295,23 @@ def _parse_a_nullable_date(data: object) -> Union[None, datetime.date]: | |||
| 272 | 295 | ||
| 273 | 296 | a_nullable_date = _parse_a_nullable_date(d.pop("a_nullable_date")) | |
| 274 | 297 | ||
| 298 | + a_uuid = UUID(d.pop("a_uuid")) | ||
| 299 | + | ||
| 300 | + def _parse_a_nullable_uuid(data: object) -> Union[None, UUID]: | ||
| 301 | + if data is None: | ||
| 302 | + return data | ||
| 303 | + try: | ||
| 304 | + if not isinstance(data, str): | ||
| 305 | + raise TypeError() | ||
| 306 | + a_nullable_uuid_type_0 = UUID(data) | ||
| 307 | + | ||
| 308 | + return a_nullable_uuid_type_0 | ||
| 309 | + except: # noqa: E722 | ||
| 310 | + pass | ||
| 311 | + return cast(Union[None, UUID], data) | ||
| 312 | + | ||
| 313 | + a_nullable_uuid = _parse_a_nullable_uuid(d.pop("a_nullable_uuid")) | ||
| 314 | + | ||
| 275 | 315 | def _parse_required_nullable(data: object) -> Union[None, str]: | |
| 276 | 316 | if data is None: | |
| 277 | 317 | return data | |
@@ -370,6 +410,13 @@ def _parse_nullable_model(data: object) -> Union["ModelWithUnionProperty", None] | |||
| 370 | 410 | else: | |
| 371 | 411 | a_not_required_date = isoparse(_a_not_required_date).date() | |
| 372 | 412 | ||
| 413 | + _a_not_required_uuid = d.pop("a_not_required_uuid", UNSET) | ||
| 414 | + a_not_required_uuid: Union[Unset, UUID] | ||
| 415 | + if isinstance(_a_not_required_uuid, Unset): | ||
| 416 | + a_not_required_uuid = UNSET | ||
| 417 | + else: | ||
| 418 | + a_not_required_uuid = UUID(_a_not_required_uuid) | ||
| 419 | + | ||
| 373 | 420 | attr_1_leading_digit = d.pop("1_leading_digit", UNSET) | |
| 374 | 421 | ||
| 375 | 422 | attr_leading_underscore = d.pop("_leading_underscore", UNSET) | |
@@ -463,6 +510,8 @@ def _parse_not_required_nullable_model(data: object) -> Union["ModelWithUnionPro | |||
| 463 | 510 | a_camel_date_time=a_camel_date_time, | |
| 464 | 511 | a_date=a_date, | |
| 465 | 512 | a_nullable_date=a_nullable_date, | |
| 513 | + a_uuid=a_uuid, | ||
| 514 | + a_nullable_uuid=a_nullable_uuid, | ||
| 466 | 515 | required_nullable=required_nullable, | |
| 467 | 516 | required_not_nullable=required_not_nullable, | |
| 468 | 517 | one_of_models=one_of_models, | |
@@ -473,6 +522,7 @@ def _parse_not_required_nullable_model(data: object) -> Union["ModelWithUnionPro | |||
| 473 | 522 | an_optional_allof_enum=an_optional_allof_enum, | |
| 474 | 523 | nested_list_of_enums=nested_list_of_enums, | |
| 475 | 524 | a_not_required_date=a_not_required_date, | |
| 525 | + a_not_required_uuid=a_not_required_uuid, | ||
| 476 | 526 | attr_1_leading_digit=attr_1_leading_digit, | |
| 477 | 527 | attr_leading_underscore=attr_leading_underscore, | |
| 478 | 528 | not_required_nullable=not_required_nullable, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments