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?
Generally speaking, swagger-core generates the API definition at runtime (just like another API endpoint). It's a bit unclear from your description how your application works. so:
Thank you for replying @RonRatovsky
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
This is most likely a CORS issue - please refer to https://github.com/swagger-api/swagger-ui/blob/master/docs/usage/cors.md.