[ ] Regression
[ ] Bug report
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
There's no option to add custom styles to the generated swagger html
have an option for the DocumentBuilder to setCustomCss that recieves a path to a css file (or scss file?)
Nest version: 5.0.0
For Tooling issues:
- Node version: 7.7.3
- Platform: Mac
I don't mind adding this myself. I just need a little guidance to where the actual swagger express module is called and passed the generated options
The SwaggerModule accepts options argument as a 4th argument:
public static setup(
path: string,
app: INestApplication,
document: SwaggerDocument,
options?: SwaggerCustomOptions
) {...}
These options are passed down to the underlying swagger-ui-express package. Here is a SwaggerCustomOptions interface:
export interface SwaggerCustomOptions {
explorer?: boolean;
swaggerOptions?: any;
customCss?: string;
customJs?: string;
customfavIcon?: string;
swaggerUrl?: string;
customSiteTitle?: string;
}
as you see, there is a customCss property available already.
@kamilmysliwiec great! thanks for the info! :-) didn't find that in the docs
Maybe it is a good point to add it into the documentation :) feel free to create a PR, if you want to
can we pass custom css 'file' in the customCss option
does this not work in fastify-swagger?
Not working when using fastify-swagger
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
The
SwaggerModuleacceptsoptionsargument as a 4th argument:These options are passed down to the underlying
swagger-ui-expresspackage. Here is aSwaggerCustomOptionsinterface:as you see, there is a
customCssproperty available already.