Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
seismic-dms-service
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
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
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OSDU
OSDU Data Platform
Domain Data Management Services
Seismic
Seismic DMS Suite
seismic-dms-service
Commits
daf0b7fa
Commit
daf0b7fa
authored
3 years ago
by
Daniel Perez
Browse files
Options
Downloads
Patches
Plain Diff
Fixing script to fix swagger style
parent
ae443e13
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!64
Slb/dperez50/fix swagger
Pipeline
#35970
passed
3 years ago
Stage: build
Stage: containerize
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
devops/scripts/style_swagger.js
+0
-20
0 additions, 20 deletions
devops/scripts/style_swagger.js
package.json
+1
-1
1 addition, 1 deletion
package.json
src/server/server.ts
+20
-0
20 additions, 0 deletions
src/server/server.ts
with
21 additions
and
21 deletions
devops/scripts/style_swagger.js
deleted
100644 → 0
+
0
−
20
View file @
ae443e13
const
replace
=
require
(
'
replace-in-file
'
);
const
options_clear
=
{
files
:
'
node_modules/swagger-ui-dist/swagger-ui.css
'
,
from
:
'
.swagger-ui .topbar{display:
\'
none
\'
;
'
,
to
:
'
.swagger-ui .topbar{
'
,
};
const
options_add_display
=
{
files
:
'
node_modules/swagger-ui-dist/swagger-ui.css
'
,
from
:
'
.swagger-ui .topbar{
'
,
to
:
'
.swagger-ui .topbar{display:
\'
none
\'
;
'
,
};
try
{
var
results
=
replace
.
sync
(
options_clear
);
console
.
log
(
'
Replacement results:
'
,
results
);
results
=
replace
.
sync
(
options_add_display
);
console
.
log
(
'
Replacement results:
'
,
results
);
}
catch
(
error
)
{
console
.
error
(
'
Error occurred:
'
,
error
);
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
package.json
+
1
−
1
View file @
daf0b7fa
...
...
@@ -17,7 +17,7 @@
"test-automation"
:
"npm run clean && npm install && npm run build && npm run test-coverage"
,
"test-e2e-parallel"
:
"node ./tests/e2e/parallel/run_e2e_tests_parallel.js"
,
"copy-static-files"
:
"copyfiles --error --up 1 ./docs/api/openapi.osdu.yaml ./dist/docs"
,
"postbuild"
:
"npm run copy-static-files
&& node devops/scripts/style_swagger.js
"
"postbuild"
:
"npm run copy-static-files"
},
"nyc"
:
{
"include"
:
[
...
...
This diff is collapsed.
Click to expand it.
src/server/server.ts
+
20
−
0
View file @
daf0b7fa
...
...
@@ -27,6 +27,7 @@ import https from 'https';
import
swaggerUi
from
'
swagger-ui-express
'
;
import
YAML
from
'
yamljs
'
;
import
replaceInFile
from
'
replace-in-file
'
// -------------------------------------------------------------------
// Seismic Store Service
...
...
@@ -69,8 +70,27 @@ export class Server {
]
}
private
options_clear
=
{
files
:
'
node_modules/swagger-ui-dist/swagger-ui.css
'
,
from
:
'
.swagger-ui .topbar{display:
\'
none
\'
;visibility:
\'
hidden
\'
'
,
to
:
'
.swagger-ui .topbar{
'
,
}
private
options_add_display
=
{
files
:
'
node_modules/swagger-ui-dist/swagger-ui.css
'
,
from
:
'
.swagger-ui .topbar{
'
,
to
:
'
.swagger-ui .topbar{display:none;visibility:hidden;
'
,
}
constructor
()
{
const
swaggerDocument
=
YAML
.
load
(
'
./dist/docs/api/openapi.osdu.yaml
'
);
try
{
replaceInFile
.
sync
(
this
.
options_clear
);
replaceInFile
.
sync
(
this
.
options_add_display
);
}
catch
(
error
)
{
console
.
error
(
'
Error occurred:
'
,
error
);
}
this
.
app
=
express
();
this
.
app
.
use
(
bodyparser
.
urlencoded
({
extended
:
false
}));
...
...
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