Skip to content

Commit

Permalink
small improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
sachaarbonel committed Sep 18, 2023
1 parent 32317dc commit 76b4385
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions openapi-gen/templates/python/type.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@
{{- end}}
{{- end}}

{{- if (not .Schema.Enum)}}
{{- if and (not .Schema.Enum) (not (gt (len .Schema.OneOf) 0))}}
from dataclasses import dataclass, field
from dataclasses_json import config, dataclass_json
{{else}}
{{else if .Schema.Enum}}
from enum import Enum
{{else if (gt (len .Schema.OneOf) 0)}}
from dataclasses import dataclass
{{- end}}

{{- if .HasNonRequired}}
Expand Down

0 comments on commit 76b4385

Please sign in to comment.