Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Refactors enumInfo for validate return type to be simpler
  • Loading branch information
spacether committed Aug 21, 2023
commit 0d9cb20b35c283ae5ec1ef6be4ae1d2d5b77a6db
Original file line number Diff line number Diff line change
Expand Up @@ -109,31 +109,43 @@ def validate(
{{/if}}
{{else}}
{{#eq this "boolean"}}
) -> {{#if ../enumInfo}}typing.Literal[
{{#if ../enumInfo}}
) -> typing.Literal[
{{#each ../enumInfo.typeToValues.boolean}}
{{#if value}}True{{else}}False{{/if}},
{{/each}}
]{{else}}bool{{/if}}:
]:
{{else}}
) -> bool:
{{/if}}
{{else}}
{{#eq this "null"}}
) -> None:
{{else}}
{{#eq this "string"}}
) -> {{#if ../enumInfo}}typing.Literal[
{{#if ../enumInfo}}
) -> typing.Literal[
{{#each ../enumInfo.typeToValues.string}}
"{{{value}}}",
{{/each}}
]{{else}}str{{/if}}:
]:
{{else}}
) -> str:
{{/if}}
{{else}}
{{#eq this "number"}}
) -> typing.Union[int, float]:
{{else}}
{{#eq this "integer"}}
) -> {{#if ../enumInfo}}typing.Literal[
{{#if ../enumInfo}}
) -> typing.Literal[
{{#each ../enumInfo.typeToValues.integer}}
{{value}},
{{{value}}},
{{/each}}
]{{else}}int{{/if}}:
]:
{{else}}
) -> int:
{{/if}}
{{else}}
{{#eq this "array"}}
{{#if arrayOutputJsonPathPiece}}
Expand Down