Skip to content

Commit dad931a

Browse files
authored
Python exp sample component renaming + additions (#6917)
* Stops converting primitive models into object models, adds ComposedSchemas with mixed type * Reverts java and mustache changes * Reverts mroe files * Samples regen * Fixes remaining tests
1 parent 29183e0 commit dad931a

File tree

60 files changed

+2151
-781
lines changed

Some content is hidden

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

60 files changed

+2151
-781
lines changed

modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml

Lines changed: 52 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -843,91 +843,108 @@ paths:
843843
responses:
844844
'400':
845845
description: Someting wrong
846-
/fake/outer/number:
846+
/fake/refs/number:
847847
post:
848848
tags:
849849
- fake
850850
description: Test serialization of outer number types
851-
operationId: fakeOuterNumberSerialize
851+
operationId: NumberWithValidations
852852
parameters:
853853
- name: body
854854
in: body
855855
description: Input number as post body
856856
schema:
857-
$ref: '#/definitions/OuterNumber'
857+
$ref: '#/definitions/NumberWithValidations'
858858
responses:
859859
'200':
860860
description: Output number
861861
schema:
862-
$ref: '#/definitions/OuterNumber'
863-
/fake/outer/string:
862+
$ref: '#/definitions/NumberWithValidations'
863+
/fake/refs/string:
864864
post:
865865
tags:
866866
- fake
867867
description: Test serialization of outer string types
868-
operationId: fakeOuterStringSerialize
868+
operationId: String
869869
parameters:
870870
- name: body
871871
in: body
872872
description: Input string as post body
873873
schema:
874-
$ref: '#/definitions/OuterString'
874+
$ref: '#/definitions/String'
875875
responses:
876876
'200':
877877
description: Output string
878878
schema:
879-
$ref: '#/definitions/OuterString'
880-
/fake/outer/boolean:
879+
$ref: '#/definitions/String'
880+
/fake/refs/boolean:
881881
post:
882882
tags:
883883
- fake
884884
description: Test serialization of outer boolean types
885-
operationId: fakeOuterBooleanSerialize
885+
operationId: Boolean
886886
parameters:
887887
- name: body
888888
in: body
889889
description: Input boolean as post body
890890
schema:
891-
$ref: '#/definitions/OuterBoolean'
891+
$ref: '#/definitions/Boolean'
892892
responses:
893893
'200':
894894
description: Output boolean
895895
schema:
896-
$ref: '#/definitions/OuterBoolean'
897-
/fake/outer/composite:
896+
$ref: '#/definitions/Boolean'
897+
/fake/refs/arraymodel:
898898
post:
899899
tags:
900900
- fake
901-
description: Test serialization of object with outer number type
902-
operationId: fakeOuterCompositeSerialize
901+
description: Test serialization of ArrayModel
902+
operationId: ArrayModel
903903
parameters:
904904
- name: body
905905
in: body
906-
description: Input composite as post body
906+
description: Input model
907907
schema:
908-
$ref: '#/definitions/OuterComposite'
908+
$ref: '#/definitions/AnimalFarm'
909909
responses:
910910
'200':
911-
description: Output composite
911+
description: Output model
912912
schema:
913-
$ref: '#/definitions/OuterComposite'
914-
/fake/outer/enum:
913+
$ref: '#/definitions/AnimalFarm'
914+
/fake/refs/object_model_with_ref_props:
915+
post:
916+
tags:
917+
- fake
918+
description: Test serialization of object with $refed properties
919+
operationId: ObjectModelWithRefProps
920+
parameters:
921+
- name: body
922+
in: body
923+
description: Input model
924+
schema:
925+
$ref: '#/definitions/ObjectModelWithRefProps'
926+
responses:
927+
'200':
928+
description: Output model
929+
schema:
930+
$ref: '#/definitions/ObjectModelWithRefProps'
931+
/fake/refs/enum:
915932
post:
916933
tags:
917934
- fake
918935
description: Test serialization of outer enum
919-
operationId: fakeOuterEnumSerialize
936+
operationId: StringEnum
920937
parameters:
921938
- name: body
922939
in: body
923-
description: Input enum as post body
940+
description: Input enum
924941
schema:
925-
$ref: '#/definitions/OuterEnum'
942+
$ref: '#/definitions/StringEnum'
926943
responses:
927944
'200':
928945
description: Output enum
929946
schema:
930-
$ref: '#/definitions/OuterEnum'
947+
$ref: '#/definitions/StringEnum'
931948
/fake/jsonFormData:
932949
get:
933950
tags:
@@ -1475,8 +1492,8 @@ definitions:
14751492
enum:
14761493
- 1.1
14771494
- -1.2
1478-
outerEnum:
1479-
$ref: '#/definitions/OuterEnum'
1495+
stringEnum:
1496+
$ref: '#/definitions/StringEnum'
14801497
AdditionalPropertiesClass:
14811498
type: object
14821499
properties:
@@ -1743,28 +1760,29 @@ definitions:
17431760
# enum:
17441761
# - Cat
17451762
# - Dog
1746-
OuterEnum:
1763+
StringEnum:
17471764
type: string
17481765
enum:
17491766
- "placed"
17501767
- "approved"
17511768
- "delivered"
1752-
OuterComposite:
1769+
ObjectModelWithRefProps:
1770+
description: a model that includes properties which should stay primitive (String + Boolean) and one which is defined as a class, NumberWithValidations
17531771
type: object
17541772
properties:
17551773
my_number:
1756-
$ref: '#/definitions/OuterNumber'
1774+
$ref: '#/definitions/NumberWithValidations'
17571775
my_string:
1758-
$ref: '#/definitions/OuterString'
1776+
$ref: '#/definitions/String'
17591777
my_boolean:
1760-
$ref: '#/definitions/OuterBoolean'
1761-
OuterNumber:
1778+
$ref: '#/definitions/Boolean'
1779+
NumberWithValidations:
17621780
type: number
17631781
minimum: 10
17641782
maximum: 20
1765-
OuterString:
1783+
String:
17661784
type: string
1767-
OuterBoolean:
1785+
Boolean:
17681786
type: boolean
17691787
x-codegen-body-parameter-name: boolean_post_body
17701788
StringBooleanMap:

0 commit comments

Comments
 (0)