fix: issue where custom assets are not injected in html #2487
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Options passed to
SwaggerModule.setup
are ignored. ThecustomOptions
object passed tobuildSwaggerHTML
is malformatted. Custom parameters that should be contained within the base ofcustomOptions
are actually contained withinswaggerOptions
, which itself contains another objectswaggerOptions
. For example, this is the object passed tobuildSwaggerHTML
when you runnpm run start:dev
:I changed how the options are parsed from the
customOptions
object inbuildSwaggerHTML
.Issue Number: #2481
What is the new behavior?
I implemented a quick fix to resolve the bug. Now, extracted the options from a merger of
customOptions
andcustomOptions.swaggerOptions
. This is not an ideal solution, but it seems this object structure is assumed in several other places in the code base, and applying a more systematic fix was non-trivial, as someone who is unfamiliar with the project.Does this PR introduce a breaking change?
Other information
I added tests for all of the custom assets so this will not inadvertently break again in the future.