Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nshmp-ws-static
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
ghsc
National Seismic Hazard Model Project
nshmp-ws-static
Commits
62663312
Commit
62663312
authored
2 years ago
by
Clayton, Brandon Scott
Browse files
Options
Downloads
Patches
Plain Diff
add swagger javascript per application
parent
be0909a2
No related branches found
No related tags found
2 merge requests
!124
Production Release | nshmp-ws-static
,
!123
Resolves - Remove GITLAB_TOKEN Requirement and AASHTO-2023 web service -- add CSV response
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/aashto/src/main/resources/swagger/index.js
+42
-0
42 additions, 0 deletions
src/aashto/src/main/resources/swagger/index.js
src/hazard/src/main/resources/swagger/index.js
+41
-0
41 additions, 0 deletions
src/hazard/src/main/resources/swagger/index.js
with
83 additions
and
0 deletions
src/aashto/src/main/resources/swagger/index.js
0 → 100644
+
42
−
0
View file @
62663312
window
.
onload
=
function
()
{
let
contextPath
=
window
.
location
.
pathname
;
contextPath
=
contextPath
.
endsWith
(
'
/
'
)
?
contextPath
.
slice
(
0
,
-
1
)
:
contextPath
;
const
ui
=
SwaggerUIBundle
({
defaultModelsExpandDepth
:
0
,
deepLinking
:
true
,
docExpansion
:
'
full
'
,
dom_id
:
'
#swagger-ui
'
,
layout
:
'
BaseLayout
'
,
plugins
:
[
SwaggerUIBundle
.
plugins
.
DownloadUrl
,
updateContextPath
(
contextPath
)],
presets
:
[
SwaggerUIBundle
.
presets
.
apis
],
tagsSorter
:
'
alpha
'
,
tryItOutEnabled
:
true
,
validatorUrl
:
null
,
url
:
`./swagger`
,
});
window
.
ui
=
ui
;
};
function
updateContextPath
(
contextPath
)
{
return
{
statePlugins
:
{
spec
:
{
wrapActions
:
{
updateJsonSpec
:
(
oriAction
)
=>
(...
args
)
=>
{
const
[
spec
]
=
args
;
if
(
spec
&&
spec
.
paths
)
{
const
newPaths
=
{};
Object
.
entries
(
spec
.
paths
).
forEach
(
([
path
,
value
])
=>
(
newPaths
[
contextPath
+
path
]
=
value
)
);
spec
.
paths
=
newPaths
;
}
oriAction
(...
args
);
},
},
},
},
};
}
This diff is collapsed.
Click to expand it.
src/hazard/src/main/resources/swagger/index.js
0 → 100644
+
41
−
0
View file @
62663312
window
.
onload
=
function
()
{
let
contextPath
=
window
.
location
.
pathname
;
contextPath
=
contextPath
.
endsWith
(
'
/
'
)
?
contextPath
.
slice
(
0
,
-
1
)
:
contextPath
;
const
ui
=
SwaggerUIBundle
({
defaultModelsExpandDepth
:
0
,
deepLinking
:
true
,
dom_id
:
'
#swagger-ui
'
,
layout
:
'
BaseLayout
'
,
plugins
:
[
SwaggerUIBundle
.
plugins
.
DownloadUrl
,
updateContextPath
(
contextPath
)],
presets
:
[
SwaggerUIBundle
.
presets
.
apis
],
tagsSorter
:
'
alpha
'
,
tryItOutEnabled
:
true
,
validatorUrl
:
null
,
url
:
`./swagger`
,
});
window
.
ui
=
ui
;
};
function
updateContextPath
(
contextPath
)
{
return
{
statePlugins
:
{
spec
:
{
wrapActions
:
{
updateJsonSpec
:
(
oriAction
)
=>
(...
args
)
=>
{
const
[
spec
]
=
args
;
if
(
spec
&&
spec
.
paths
)
{
const
newPaths
=
{};
Object
.
entries
(
spec
.
paths
).
forEach
(
([
path
,
value
])
=>
(
newPaths
[
contextPath
+
path
]
=
value
)
);
spec
.
paths
=
newPaths
;
}
oriAction
(...
args
);
},
},
},
},
};
}
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