pmm
pmm copied to clipboard
PMM-10495 Avoid swagger validation when browsing /swagger
By default, Swagger UI attempts to validate specs against swagger.io's online validator. You can use this parameter to set a different validator URL, for example for locally deployed validators (Validator Badge). Setting it to either none, 127.0.0.1 or localhost will disable validation.
https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration/#network
- Set validatorUrl to an empty string
Build: SUBMODULES-2701
Codecov Report
Merging #1140 (c2ff622) into main (3821ef4) will increase coverage by
0.10%
. The diff coverage isn/a
.
@@ Coverage Diff @@
## main #1140 +/- ##
==========================================
+ Coverage 45.27% 45.37% +0.10%
==========================================
Files 140 140
Lines 13568 13568
==========================================
+ Hits 6143 6157 +14
+ Misses 7033 7019 -14
Partials 392 392
Flag | Coverage Δ | |
---|---|---|
admin | 24.41% <ø> (ø) |
|
agent | 54.03% <ø> (+0.14%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
Impacted Files | Coverage Δ | |
---|---|---|
agent/agents/mysql/slowlog/slowlog.go | 51.27% <0.00%> (+2.97%) |
:arrow_up: |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
Ceri, this is quite hard to review. Is there any way for us to "rebuild from source"? I know we are just grabbing the files from swagger's ui repo, but I was wondering how you actually made those changes to compiled files?
Ceri, this is quite hard to review. Is there any way for us to "rebuild from source"? I know we are just grabbing the files from swagger's ui repo, but I was wondering how you actually made those changes to compiled files?
@atymchuk they aren't compiled, just minified from what I can tell. It was simply applying the workaround from the ticket:
sed -i 's;validatorUrl:"https://validator.swagger.io/validator";validatorUrl:"";g' *
How are the files normally updated? I didn't notice a make
command to pull in files, so I presume that it is manual, in which case perhaps Makefile.include
needs something extra
How are the files normally updated? I didn't notice a
make
command to pull in files, so I presume that it is manual, in which case perhapsMakefile.include
needs something extra
I believe they are copied from here
@BupycHuk that file is also part of the bundle when downloaded, so really it only reduces the number of files that need to be edited. I have added download_swagger
and update_swagger
, so make update_swagger
can be used to pull in the latest version and patch swagger-initializer.js
as part of the process
@cezmunsta, yeah, but it's much easier to see differences in the configuration file than in obfuscated files