This repository was archived by the owner on Dec 25, 2024. It is now read-only.
Commit 90e9d30
committed
v3 convert nested schemas into sequential schemas (#177)
* Writes nested schemas earlier and uses them later
* Refactors order CodegenSchema properties are set in to match the order in getSchemas
* Adjusts ref input to setSchemaLocationInfo
* Tweak improves schema template
* Adds properties classes
* Replaces properties with field
* Uses Schema_()
* Uses dataclass properties
* Adds missing type info
* Updates all_of
* Adds any_of, all_of tuples
* Fixes types definition
* Fixed test_any_type_schema tests
* Fixes dataclass type setting issues
* Fixes simple schema format type
* Adds and uses PatternInfo for pattern schema info, validate_regex changed to validate_pattern
* Fixes not constraint tests
* Adds tuple_to_instance
* Writes out allOf/anyOf/oneOf types
* Updates classproperty decorator
* Adds enum return types
* Fixes type errors in schemas.py
* Adds schema singleton metaclass
* Replaces CodegenServer variables with object schema containing variables in properties
* Generates server variables as an object schema to keep all schemas at the root depth
* Fixes new signatures in servers schemas
* Simplifies Server variables definition
* Uses schema default for server variables
* Adds required vars in server definition
* Fixes classproperty and SchemaBase classes
* Fixes broken configuration tests
* Fixes server docs
* Adds isInlineDefinition
* Adds allOf/anyOf/oneOf/properties jsonPathPiece
* Uses jsonPathPiece in properties/allOf/anyOf/oneOf
* Fixes properties typeddict name
* Templates updated to write allOf/anyOf/oneOf/properties earlier if possible
* generates properties/allOf/anyOf/oneOf before class if possible
* Adds and uses schemas.INPUT_TYPES_ALL_INCL_SCHEMA
* Adds another usage of schemas.INPUT_TYPES_ALL_INCL_SCHEMA
* Changes SchemaBase to SingletonMeta
* Only calculates allSchemas once
* Reduces iteration through allSchemas from 2x to 1x
* Removes some getKey invocations
* Consolidates more getKey usages
* Deletes getKey with one input
* Adds comment
* Updates the definition of required properties, reduces the number of calls to getKey
* Updates getKey to use sourceJsonPath
* Adds class name generation that includes numbered suffixes when needed
* Uses pre order traversal for naming schema classes
* Fixes oneOf/anyOf/allOf type aliases
* Adds and uses schemas.INPUT_BASE_TYPES
* Adds string representation of CodegenKey
* Fixes java tests
* Samples regenerated
* Samples regenerated1 parent 5bafc7a commit 90e9d30
409 files changed
Lines changed: 13691 additions & 18415 deletions
File tree
- modules/openapi-json-schema-generator/src
- main
- java/org/openapijsonschematools/codegen
- languages
- model
- resources/python
- components/schemas
- configurations
- servers
- test/java/org/openapijsonschematools/codegen
- samples/openapi3/client
- 3_0_3_unit_test/python
- docs/components/schema
- src/unit_test_api
- components/schema
- configurations
- servers
- features
- nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package
- components/schema
- configurations
- servers
- security/python/src/this_package
- configurations
- servers
- petstore/python
- docs/components/schema
- src/petstore_api
- components
- headers
- header_int32_json_content_type_header/content/application_json
- header_number_header
- header_string_header
- parameters/parameter_path_user_name
- request_bodies/request_body_user_array/content/application_json
- responses
- response_success_inline_content_and_header
- content/application_json
- headers/header_some_header
- response_successful_xml_and_json_array_of_pet/content
- application_json
- application_xml
- schema
- configurations
- paths
- fake_body_with_query_params/put/parameters/parameter_0
- fake_case_sensitive_params/put/parameters
- parameter_0
- parameter_1
- parameter_2
- fake_delete_coffee_id/delete/parameters/parameter_0
- fake_inline_additional_properties/post/request_body/content/application_json
- fake_inline_composition/post
- parameters
- parameter_0
- parameter_1
- request_body/content
- application_json
- multipart_form_data
- responses/response_200/content
- application_json
- multipart_form_data
- fake_json_form_data/get/request_body/content/application_x_www_form_urlencoded
- fake_json_with_charset/post
- request_body/content/application_json_charsetutf8
- responses/response_200/content/application_json_charsetutf8
- fake_multiple_response_bodies/get/responses
- response_200/content/application_json
- response_202/content/application_json
- fake_multiple_securities/get/responses/response_200/content/application_json
- fake_obj_in_query/get/parameters/parameter_0
- fake_parameter_collisions1_abab_self_ab/post
- parameters
- parameter_0
- parameter_10
- parameter_11
- parameter_12
- parameter_13
- parameter_14
- parameter_15
- parameter_16
- parameter_17
- parameter_18
- parameter_1
- parameter_2
- parameter_3
- parameter_4
- parameter_5
- parameter_6
- parameter_7
- parameter_8
- parameter_9
- request_body/content/application_json
- responses/response_200/content/application_json
- fake_pet_id_upload_image_with_required_file/post
- parameters/parameter_0
- request_body/content/multipart_form_data
- fake_query_param_with_json_content_type/get
- parameters/parameter_0/content/application_json
- responses/response_200/content/application_json
- fake_test_query_paramters/put/parameters
- parameter_0
- parameter_1
- parameter_2
- parameter_3
- parameter_4
- fake_upload_download_file/post
- request_body/content/application_octet_stream
- responses/response_200/content/application_octet_stream
- fake_upload_files/post/request_body/content/multipart_form_data
- fake_upload_file/post/request_body/content/multipart_form_data
- fake_wild_card_responses/get/responses
- response_1xx/content/application_json
- response_200/content/application_json
- response_2xx/content/application_json
- response_3xx/content/application_json
- response_4xx/content/application_json
- response_5xx/content/application_json
- fake
- delete/parameters
- parameter_0
- parameter_1
- parameter_2
- parameter_3
- parameter_4
- parameter_5
- get
- parameters
- parameter_0
- parameter_1
- parameter_2
- parameter_3
- parameter_4
- parameter_5
- request_body/content/application_x_www_form_urlencoded
- responses/response_404/content/application_json
- post/request_body/content/application_x_www_form_urlencoded
- foo/get
- responses/response_default/content/application_json
- servers
- pet_find_by_status
- get/parameters/parameter_0
- servers
- pet_find_by_tags/get/parameters/parameter_0
- pet_pet_id_upload_image/post
- parameters/parameter_0
- request_body/content/multipart_form_data
- pet_pet_id
- delete/parameters
- parameter_0
- parameter_1
- get/parameters/parameter_0
- post
- parameters/parameter_0
- request_body/content/application_x_www_form_urlencoded
- store_order_order_id
- delete/parameters/parameter_0
- get/parameters/parameter_0
- user_login/get
- parameters
- parameter_0
- parameter_1
- responses/response_200
- content
- application_json
- application_xml
- headers
- header_x_expires_after
- header_x_rate_limit/content/application_json
- servers
- tests_manual
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
| 147 | + | |
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
| 159 | + | |
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| |||
Lines changed: 170 additions & 136 deletions
Large diffs are not rendered by default.
Lines changed: 10 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
765 | 765 | | |
766 | 766 | | |
767 | 767 | | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
768 | 772 | | |
769 | 773 | | |
| 774 | + | |
770 | 775 | | |
771 | 776 | | |
772 | 777 | | |
| |||
809 | 814 | | |
810 | 815 | | |
811 | 816 | | |
812 | | - | |
813 | | - | |
| 817 | + | |
| 818 | + | |
814 | 819 | | |
815 | 820 | | |
816 | 821 | | |
| |||
820 | 825 | | |
821 | 826 | | |
822 | 827 | | |
823 | | - | |
| 828 | + | |
824 | 829 | | |
825 | 830 | | |
826 | 831 | | |
| |||
1356 | 1361 | | |
1357 | 1362 | | |
1358 | 1363 | | |
1359 | | - | |
| 1364 | + | |
1360 | 1365 | | |
1361 | 1366 | | |
1362 | 1367 | | |
| |||
1523 | 1528 | | |
1524 | 1529 | | |
1525 | 1530 | | |
1526 | | - | |
| 1531 | + | |
1527 | 1532 | | |
1528 | 1533 | | |
1529 | 1534 | | |
| |||
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
32 | 44 | | |
33 | 45 | | |
34 | 46 | | |
| |||
Lines changed: 125 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
49 | | - | |
50 | | - | |
51 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | | - | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
89 | 96 | | |
90 | 97 | | |
91 | 98 | | |
| |||
126 | 133 | | |
127 | 134 | | |
128 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
129 | 248 | | |
130 | 249 | | |
131 | 250 | | |
| |||
137 | 256 | | |
138 | 257 | | |
139 | 258 | | |
140 | | - | |
| 259 | + | |
141 | 260 | | |
142 | 261 | | |
143 | 262 | | |
| |||
186 | 305 | | |
187 | 306 | | |
188 | 307 | | |
| 308 | + | |
189 | 309 | | |
190 | 310 | | |
191 | 311 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
0 commit comments