Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
api-generator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
scc-net
netvs
api-generator
Commits
dacb88ab
Commit
dacb88ab
authored
1 month ago
by
Sebastian Böckelmann
Browse files
Options
Downloads
Patches
Plain Diff
FIX: Consider Dependencies of schemas on all layers
parent
c2ac4fff
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
net_api_generator/middleware_generator/MiddlewareLoader.py
+20
-9
20 additions, 9 deletions
net_api_generator/middleware_generator/MiddlewareLoader.py
with
20 additions
and
9 deletions
net_api_generator/middleware_generator/MiddlewareLoader.py
+
20
−
9
View file @
dacb88ab
...
...
@@ -100,17 +100,28 @@ class MiddlewareLoader:
raise
ValueError
(
'
Unexpected structure of Open API Component
'
)
def
determine_api_object_loading_order
(
self
,
components
:
dict
):
def
find_reference_dependencies
(
dictionary
:
dict
)
->
list
[
str
]:
if
"
$ref
"
in
dictionary
:
return
[
dictionary
[
'
$ref
'
].
split
(
'
/
'
)[
-
1
]]
else
:
dependencies
=
[]
for
value
in
dictionary
.
values
():
if
isinstance
(
value
,
dict
):
if
(
found
:
=
find_reference_dependencies
(
value
))
is
not
None
:
dependencies
.
extend
(
found
)
elif
isinstance
(
value
,
list
):
for
list_item
in
value
:
if
isinstance
(
list_item
,
dict
):
if
(
found
:
=
find_reference_dependencies
(
list_item
))
is
not
None
:
dependencies
.
extend
(
found
)
return
dependencies
ts
=
TopologicalSorter
()
for
component_key
,
component
in
components
.
items
():
if
'
properties
'
in
component
:
for
component_property
in
component
[
'
properties
'
].
values
():
if
'
$ref
'
in
component_property
:
referer
=
component_property
[
'
$ref
'
].
split
(
'
/
'
)[
-
1
]
ts
.
add
(
component_key
,
referer
)
else
:
ts
.
add
(
component_key
)
else
:
ts
.
add
(
component_key
)
references
=
find_reference_dependencies
(
component
)
for
reference
in
references
:
ts
.
add
(
component_key
,
reference
)
result
=
list
(
ts
.
static_order
())
return
result
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment