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

v2 removes stub files #148

Merged
merged 2 commits into from
Apr 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,6 @@ public void processOpts() {

HashMap<String, String> schemaTemplates = new HashMap<>();
schemaTemplates.put("components/schemas/schema.hbs", ".py");
schemaTemplates.put("components/schemas/schema_stub.hbs", ".pyi");
jsonPathTemplateFiles.put(
CodegenConstants.JSON_PATH_LOCATION_TYPE.SCHEMA,
schemaTemplates
Expand Down Expand Up @@ -578,7 +577,6 @@ public void processOpts() {
HashMap<String, String> operationTemplates = new HashMap<>();
operationTemplates.put("__init__.hbs", File.separatorChar + "__init__.py");
operationTemplates.put("paths/path/verb/operation.hbs", File.separatorChar + "operation.py");
operationTemplates.put("paths/path/verb/operation_stub.hbs", File.separatorChar + "operation.pyi");
jsonPathTemplateFiles.put(
CodegenConstants.JSON_PATH_LOCATION_TYPE.OPERATION,
operationTemplates
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,9 @@ class {{jsonPathPiece.camelCase}}(
{{#or additionalProperties requiredProperties hasDiscriminatorWithNonEmptyMapping properties}}
{{> components/schemas/_helper_dict_partial identifierPieces=(append identifierPieces "Schema_") }}
{{/or}}
{{#unless isStub}}
{{#if hasValidation}}
{{> components/schemas/_helper_validations }}
{{/if}}
{{/unless}}
{{#or allOf anyOf oneOf not}}
{{> components/schemas/_helper_composed_schemas identifierPieces=(append identifierPieces "Schema_") }}
{{/or}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ class {{jsonPathPiece.camelCase}}(
{{/if}}
"""
{{/if}}
{{#if isStub}}
{{#or additionalProperties requiredProperties hasDiscriminatorWithNonEmptyMapping properties}}


class Schema_:
{{> components/schemas/_helper_dict_partial identifierPieces=(append identifierPieces "Schema_") }}
{{/or}}
{{else}}
{{#or additionalProperties requiredProperties hasDiscriminatorWithNonEmptyMapping properties hasValidation}}


Expand All @@ -30,7 +22,6 @@ class {{jsonPathPiece.camelCase}}(
{{> components/schemas/_helper_dict_partial identifierPieces=(append identifierPieces "Schema_") }}
{{> components/schemas/_helper_validations }}
{{/or}}
{{/if}}
{{> components/schemas/_helper_property_type_hints }}

{{> components/schemas/_helper_new }}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class {{jsonPathPiece.camelCase}}(
{{/if}}
"""
{{/if}}
{{#unless isStub}}
{{#or hasValidation enumValueToName format defaultValue}}


Expand Down Expand Up @@ -58,14 +57,6 @@ class {{jsonPathPiece.camelCase}}(
{{> components/schemas/_helper_schema_enum }}
{{/if}}
{{/or}}
{{/unless}}
{{#if enumValueToName}}
{{> components/schemas/_helper_enums }}
{{/if}}
{{#if isStub}}
{{#or hasValidation defaultValue}}
{{#unless enumValueToName}}
pass
{{/unless}}
{{/or}}
{{/if}}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ from {{packageName}}.security import (
{{> _helper_imports }}
{{#with operation}}

{{#unless isStub}}
from .. import path
{{/unless}}
{{#if responses}}
{{#eq responses.size 1}}
{{#each responses}}
Expand Down Expand Up @@ -98,7 +96,6 @@ from .security import (
{{> paths/path/verb/_helper_operation_parameter_schema_and_def xParams=cookieParams xParamsName="RequestCookieParameters" }}
{{/if}}
{{/or}}
{{#unless isStub}}
{{#neq security null}}
{{#gt security.size 0}}

Expand All @@ -120,8 +117,6 @@ _security: typing.List[security_schemes.SecurityRequirementObject] = [
{{/gt}}
{{/neq}}
{{/neq}}
{{/unless}}
{{#unless isStub}}


{{#if defaultResponse}}
Expand All @@ -144,7 +139,6 @@ _status_code_to_response: __StatusCodeToResponse = {
{{/each}}
}
{{/if}}
{{/unless}}
{{#each produces}}
{{#if @first}}

Expand Down

This file was deleted.

Large diffs are not rendered by default.

This file was deleted.

This file was deleted.

This file was deleted.

Loading