Contributions
Re: How to automatically save generated /swagger.json into a local file
Thank you for replyingRonRatovsky I would like to point the UI to the generated definition at runtime but i get a "Failed to Load spec". This may be because to access the definition, there must be some authentication and custom header added. I am using a url like this on index.html window.onload = function() { // Build a system const ui = SwaggerUIBundle({ url: "https://localhost:8443/example.swagger.io/api/v1/swagger.json?Platform-TenantId=default&&Authorization=Basic bWlmb3M6cGFzc3dvcmQ=", dom_id: '#swagger-ui', validatorUrl : false, presets: [ SwaggerUIBundle.presets.apis, SwaggerUIStandalonePreset ], plugins: [ SwaggerUIBundle.plugins.DownloadUrl ], layout: "StandaloneLayout" }) Also the try it out buttons on the swagger ui do not function when i use the path url to the locally saved swagger spec. I think it may be due to the authentication and header to be added on every request inorder to access to the server. How can i resolve this please?5.9KViews0likes1CommentHow to automatically save generated /swagger.json into a local file
Hello, I am new here. I am using swagger core to generate my swagger specification files. I am also using swagger ui dist folder to access swagger ui. To view my swagger document with index.html, i have generated swagger.json using rest client, then copy the spec into a file named response.json then put that file into swagger ui dist folder. From there i can change the url in index.html into the path to the spec file. Each time i add swagger annotations on the resource classes, i build the project and a new swagger.json gets generated and i have change the contents of the response.json into my new swagger.json to view the new changes made. Is there a way that after building my project,it will first hit the endpoint to generate swagger.json and save it as response.json in our swagger-ui folder?6KViews0likes3Comments