Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
scc-net
netvs
netvs-core
Commits
0d2a0f47
Commit
0d2a0f47
authored
Mar 04, 2020
by
janis.streib
🦉
Browse files
FIX: array type representation in properties
parent
d7227a61
Pipeline
#77325
passed with stages
in 5 minutes and 59 seconds
Changes
1
Pipelines
15
Hide whitespace changes
Inline
Side-by-side
frontend/generate_base_model.py
View file @
0d2a0f47
...
...
@@ -167,6 +167,20 @@ def setDef(tmp):
return
res
def
gen_param_defs
(
d
,
scope
):
defs
=
{
'type'
:
d
[
'dataType'
][
'json_name'
],
'description'
:
d
[
'description'
],
'required'
:
d
[
scope
][
'isRequired'
],
'nullable'
:
d
[
scope
][
'isNullable'
],
'has_def'
:
'dataDefault'
in
d
[
scope
],
'default'
:
d
[
scope
].
get
(
'dataDefault'
,
None
)
}
if
d
[
'dataType'
][
'json_name'
]
==
'array'
:
defs
[
'items'
]
=
{
'type'
:
'string'
}
return
defs
def
generateParamters
(
f
):
if
not
f
[
'is_data_manipulating'
]:
tmp
=
[
...
...
@@ -184,25 +198,12 @@ def generateParamters(f):
for
p
,
d
in
f
[
'parameters'
].
items
()]
return
setDef
(
tmp
)
new_params
=
{
p
:
{
'type'
:
d
[
'dataType'
][
'json_name'
],
'description'
:
d
[
'description'
],
'required'
:
d
[
'new'
][
'isRequired'
],
'nullable'
:
d
[
'new'
][
'isNullable'
],
'has_def'
:
'dataDefault'
in
d
[
'new'
],
'default'
:
d
[
'new'
].
get
(
'dataDefault'
,
None
)
}
for
p
,
d
in
f
[
'parameters'
].
items
()
if
'new'
in
d
p
:
gen_param_defs
(
d
,
'new'
)
for
p
,
d
in
f
[
'parameters'
].
items
()
if
'new'
in
d
}
old_params
=
{
p
:
{
'type'
:
d
[
'dataType'
][
'json_name'
],
'description'
:
d
[
'description'
],
'required'
:
d
[
'old'
][
'isRequired'
],
'nullable'
:
d
[
'old'
][
'isNullable'
],
'has_def'
:
'dataDefault'
in
d
[
'old'
],
'default'
:
d
[
'old'
].
get
(
'dataDefault'
,
None
)
}
p
:
gen_param_defs
(
d
,
'old'
)
for
p
,
d
in
f
[
'parameters'
].
items
()
if
'old'
in
d
}
old_params
=
{
k
:
setDef
([
v
])[
0
]
for
k
,
v
in
old_params
.
items
()}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment