Skip to content

Commit

Permalink
support array inside additionalProperties
Browse files Browse the repository at this point in the history
  • Loading branch information
sachaarbonel committed Sep 18, 2023
1 parent 2ed1bb8 commit 0bd06ea
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions openapi-gen/templates/python/type.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@
{{- $typingImports = append $typingImports "List"}}
{{- end}}
{{- end}}
{{- if and (eq .Value.Type "object") (.Value.AdditionalProperties) (.Value.AdditionalProperties.Schema)}}
{{- if not (contains $typingImports "Dict")}}
{{- if and (eq .Value.Type "object") (.Value.AdditionalProperties)}}
{{- if and (.Value.AdditionalProperties.Schema) (eq .Value.AdditionalProperties.Schema.Value.Type "array")}}
{{- if not (contains $typingImports "List")}}
{{- $typingImports = append $typingImports "List"}}
{{- end}}
{{- end}}
{{- if and (.Value.AdditionalProperties.Schema) (not (contains $typingImports "Dict"))}}
{{- $typingImports = append $typingImports "Dict"}}
{{- end}}
{{- end}}
Expand Down

0 comments on commit 0bd06ea

Please sign in to comment.