문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 다음 판 양쪽 다음 판 | ||
programming:documentation:swagger [2018/07/24 13:44] kwon37xi [SpringBoot] |
programming:documentation:swagger [2019/10/30 15:30] kwon37xi [ReDoc] |
||
---|---|---|---|
줄 1: | 줄 1: | ||
====== Swagger ====== | ====== Swagger ====== | ||
* http:// | * http:// | ||
+ | * [[springframework: | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
- | ===== Spring MVC and swagger | + | ===== ReDoc ===== |
- | * [[https:// | + | * [[https:// |
- | * [[https:// | + | * [[https://webhookrelay.com/blog/2018/11/05/openapi-redoc-tutorial/|Documenting your API with OpenAPI (Swagger) and Redoc — Web Relay]] |
- | * Spring MVC Swagger 튜토리얼 시리즈 | + | |
- | * [[http:// | + | |
- | * [[http://www.javacodegeeks.com/2014/11/spring-rest-api-with-swagger-exposing-documentation.html|Spring Rest API with Swagger | + | |
- | * Spring MVC API 적용 Servlet의 "/" | + | |
- | // /css/*, /js/* 등에 대한 핸들러 추가. | + | |
- | @Override | + | |
- | protected void addResourceHandlers(ResourceHandlerRegistry registry) { | + | |
- | registry.addResourceHandler(" | + | |
- | .addResourceLocations(WEB_JAR_RESOURCE_LOCATION, | + | |
- | WEB_JAR_RESOURCE_LOCATION + " | + | |
- | WEB_JAR_RESOURCE_LOCATION + " | + | |
- | WEB_JAR_RESOURCE_LOCATION + " | + | |
- | WEB_JAR_RESOURCE_LOCATION + " | + | |
- | .setCachePeriod(0); | + | |
- | super.addResourceHandlers(registry); | + | |
- | } | + | |
- | + | ||
- | @ApiIgnore | + | |
- | @Controller | + | |
- | public class SwaggerController { | + | |
- | @Autowired | + | |
- | private ResourceLoader resourceLoader; | + | |
- | + | ||
- | @RequestMapping("/ | + | |
- | public void swagger(HttpServletResponse response) throws IOException { | + | |
- | final Resource swaggerHtmlResource = | + | |
- | resourceLoader.getResource(" | + | |
- | + | ||
- | final String swaggerHtmlContents = | + | |
- | CoupangIOUtils.toString(swaggerHtmlResource.getInputStream(), | + | |
- | final String refinedHtml = swaggerHtmlContents | + | |
- | .replaceAll(" | + | |
- | + | ||
- | response.setContentType(" | + | |
- | final PrintWriter writer = response.getWriter(); | + | |
- | writer.write(refinedHtml); | + | |
- | writer.close(); | + | |
- | } | + | |
- | } | + | |
- | </ | + | |
+ | ===== Swagger2MarkUp ===== | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// |