How does Jhipster generate swagger info? - jhipster

How/where does the swagger json for the swagger ui get generated ?
I thought maybe it was Springfox that was automatically doing it, but if I add a field without using the Jhipster 'entity creation' feature the field does not show up in the swagger docs. So obviously something generates it pre build..

Related

Display value of header instead of *** in NestJS Swagger UI

I have added the new header x-zp-auth-provider to Swagger UI by addSecurity and I want it to display its value instead of *****
Is there any way to do this?
Not out of the box.
You'll have to fork Swagger UI, modify the relevant code, rebuild the assets with your changes, and then configure NestJS to use your forked version instead of the standard Swagger UI.
The code that masks API keys and Bearer tokens with ****** is here:
api-key-auth.jsx
http-auth.jsx

swagger - extract parameter info from express-validation

I'm new to node, swagger etc.
I'm working on a node.js app, I added some endpoints and using express-validation package I configured validators for my end points.
I now started using also swagger-autogen to generate swagger doc, but I can't find a way to make swagger use the validators in order to provide more data/limitations of the endpoints' parameters.
Is there a way to achieve something like that?
Thanks

How Do I Update the Swagger UI Documentation in JHipster?

In my JHipster app, I have manually updated the OpenAPI spec file (api.yml), following official instructions for API-first development.
However, the documentation (generated via Springfox) does not update, and still lists the endpoints described in the original (default) content of the api.yml.
As per Springfox's documentation,
All content is served from a webjar convention, relative url taking the following form: webjars/springfox-swagger-ui/2.9.2/swagger-ui.html
But there's no word about how to update that. Any ideas/clues welcome.
Thanks!

what is the proper way to create a swagger web service in TypeScript

I am part of a project written in TypeScipt and I am trying to add TypeScript Web Server which will be compatible with Swagger.
What is the most basic strategy to implement it, considering easy maintainability.
For Typescript I have notice that exists 'Typson' library for generating a JSON Model from TypeScript Interface.
For Swagger, I have tried using 'swagger-node-restify' library, since it supports adding JSON models to swagger.
However, I encounter some problems:
Typson doesn't support typeScript syntax of Import -
(import {Server} from "restify")
I tried to implement the 'swagger-node-restify' example (Pet Example), however the RESPONSE of the localhost:8080/api-docs.json GET Request is missing all the SPEC data of the API.
{"apiVersion":"0.1","swaggerVersion":"1.1","basePath":"http://localhost:8080","apis":[{"path":"/api-docs.{format}/pet","description":"none"}]}
I suggest to describe a Swagger compliant API using yaml or json and to generate the server from that.
swagger-server can build APIs on top of express in real time (no source code generation).
There are JavaScript code generators :
Call the swagger-codegen client with -l nodejs-server
swagger-node is a great alternative but seems hard to integrate with TypeScript
Yes, you can easily generate Swagger and OpenAPI documents from your TypeScript types by using tsoa. The readme contains all of the setup information that you would need to start using it. It's compatible with express, hapi, koa, and more (via the ability to add your own template for your preferred server type):
https://github.com/lukeautry/tsoa
The advantages that tsoa has over other libraries is:
it both generates the swagger/OpenAPI document and it also validates the types at runtime
(Full Transparency: I am one of the maintainers of tsoa. But I was first a consumer of tsoa and I find it to be a great product... that's why I asked to help maintain it! :) )

I am using sails-swagger to generate the swagger docs i am getting only json format documnetation not swagger ui

This is the document i am getting but not the swagger ui. I want to get the document in swagger-ui format
I have used https://github.com/tjwebb/sails-swagger
sails-swagger doesn't provide swagger-ui. You need to set up it by yourself and point to /swagger/doc.

Resources