Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Commit f5cd398

Browse files
authored
v2 removes stub files (#148)
* Removes pyi files * Removes isStub from templates
1 parent 2913d07 commit f5cd398

File tree

949 files changed

+0
-158053
lines changed

Some content is hidden

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

949 files changed

+0
-158053
lines changed

modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/PythonClientCodegen.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,6 @@ public void processOpts() {
463463

464464
HashMap<String, String> schemaTemplates = new HashMap<>();
465465
schemaTemplates.put("components/schemas/schema.hbs", ".py");
466-
schemaTemplates.put("components/schemas/schema_stub.hbs", ".pyi");
467466
jsonPathTemplateFiles.put(
468467
CodegenConstants.JSON_PATH_LOCATION_TYPE.SCHEMA,
469468
schemaTemplates
@@ -578,7 +577,6 @@ public void processOpts() {
578577
HashMap<String, String> operationTemplates = new HashMap<>();
579578
operationTemplates.put("__init__.hbs", File.separatorChar + "__init__.py");
580579
operationTemplates.put("paths/path/verb/operation.hbs", File.separatorChar + "operation.py");
581-
operationTemplates.put("paths/path/verb/operation_stub.hbs", File.separatorChar + "operation.pyi");
582580
jsonPathTemplateFiles.put(
583581
CodegenConstants.JSON_PATH_LOCATION_TYPE.OPERATION,
584582
operationTemplates

modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_schema_composed_or_anytype.hbs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,9 @@ class {{jsonPathPiece.camelCase}}(
5555
{{#or additionalProperties requiredProperties hasDiscriminatorWithNonEmptyMapping properties}}
5656
{{> components/schemas/_helper_dict_partial identifierPieces=(append identifierPieces "Schema_") }}
5757
{{/or}}
58-
{{#unless isStub}}
5958
{{#if hasValidation}}
6059
{{> components/schemas/_helper_validations }}
6160
{{/if}}
62-
{{/unless}}
6361
{{#or allOf anyOf oneOf not}}
6462
{{> components/schemas/_helper_composed_schemas identifierPieces=(append identifierPieces "Schema_") }}
6563
{{/or}}

modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_schema_dict.hbs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,6 @@ class {{jsonPathPiece.camelCase}}(
1414
{{/if}}
1515
"""
1616
{{/if}}
17-
{{#if isStub}}
18-
{{#or additionalProperties requiredProperties hasDiscriminatorWithNonEmptyMapping properties}}
19-
20-
21-
class Schema_:
22-
{{> components/schemas/_helper_dict_partial identifierPieces=(append identifierPieces "Schema_") }}
23-
{{/or}}
24-
{{else}}
2517
{{#or additionalProperties requiredProperties hasDiscriminatorWithNonEmptyMapping properties hasValidation}}
2618

2719

@@ -30,7 +22,6 @@ class {{jsonPathPiece.camelCase}}(
3022
{{> components/schemas/_helper_dict_partial identifierPieces=(append identifierPieces "Schema_") }}
3123
{{> components/schemas/_helper_validations }}
3224
{{/or}}
33-
{{/if}}
3425
{{> components/schemas/_helper_property_type_hints }}
3526

3627
{{> components/schemas/_helper_new }}

modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_schema_simple.hbs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ class {{jsonPathPiece.camelCase}}(
1818
{{/if}}
1919
"""
2020
{{/if}}
21-
{{#unless isStub}}
2221
{{#or hasValidation enumValueToName format defaultValue}}
2322

2423

@@ -58,14 +57,6 @@ class {{jsonPathPiece.camelCase}}(
5857
{{> components/schemas/_helper_schema_enum }}
5958
{{/if}}
6059
{{/or}}
61-
{{/unless}}
6260
{{#if enumValueToName}}
6361
{{> components/schemas/_helper_enums }}
64-
{{/if}}
65-
{{#if isStub}}
66-
{{#or hasValidation defaultValue}}
67-
{{#unless enumValueToName}}
68-
pass
69-
{{/unless}}
70-
{{/or}}
7162
{{/if}}

modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/schema_stub.hbs

Lines changed: 0 additions & 1 deletion
This file was deleted.

modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/operation.hbs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ from {{packageName}}.security import (
3636
{{> _helper_imports }}
3737
{{#with operation}}
3838

39-
{{#unless isStub}}
4039
from .. import path
41-
{{/unless}}
4240
{{#if responses}}
4341
{{#eq responses.size 1}}
4442
{{#each responses}}
@@ -98,7 +96,6 @@ from .security import (
9896
{{> paths/path/verb/_helper_operation_parameter_schema_and_def xParams=cookieParams xParamsName="RequestCookieParameters" }}
9997
{{/if}}
10098
{{/or}}
101-
{{#unless isStub}}
10299
{{#neq security null}}
103100
{{#gt security.size 0}}
104101

@@ -120,8 +117,6 @@ _security: typing.List[security_schemes.SecurityRequirementObject] = [
120117
{{/gt}}
121118
{{/neq}}
122119
{{/neq}}
123-
{{/unless}}
124-
{{#unless isStub}}
125120

126121

127122
{{#if defaultResponse}}
@@ -144,7 +139,6 @@ _status_code_to_response: __StatusCodeToResponse = {
144139
{{/each}}
145140
}
146141
{{/if}}
147-
{{/unless}}
148142
{{#each produces}}
149143
{{#if @first}}
150144

modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/operation_stub.hbs

Lines changed: 0 additions & 1 deletion
This file was deleted.

samples/openapi3/client/3_0_3_unit_test/python/.openapi-generator/FILES

Lines changed: 0 additions & 435 deletions
Large diffs are not rendered by default.

samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/_not.pyi

Lines changed: 0 additions & 52 deletions
This file was deleted.

samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/additionalproperties_allows_a_schema_which_should_validate.pyi

Lines changed: 0 additions & 101 deletions
This file was deleted.

samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/additionalproperties_are_allowed_by_default.pyi

Lines changed: 0 additions & 102 deletions
This file was deleted.

0 commit comments

Comments
 (0)