Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swagger UI 설정 #46

Merged
merged 10 commits into from
Jul 24, 2023
Merged

Swagger UI 설정 #46

merged 10 commits into from
Jul 24, 2023

Conversation

kyY00n
Copy link
Collaborator

@kyY00n kyY00n commented Jul 20, 2023

📄 Summary

swagger ui를 추가했습니다

restassured로 openapi 스펙 야믈을 만들어주는 라이브러리를 사용하고 있었는데요
스프링 버전에 맞게 버전 수정해줬습니다.

그리고 스크립트 수정했어요 순서대로 읽을 수 있게 정의했어요

openapi3 { // openapi3.yml 생성기능 설정
    setServer("http://localhost:8080")
    title = "집사의고민 API Docs"
    description = "집사의고민 API 명세서"
    version = "1.0.0"
    format = "yaml"
}

swaggerSources {
    zipgo {
        setInputFile(file("build/api-spec/openapi3.yaml")) // swaggerUI를 만들기위한 openapi3.yml의 위치
    }
}

tasks.withType(GenerateSwaggerUI) {
    dependsOn 'openapi3'
}

generateSwaggerUIZipgo { // zipgo 스웨거 task
    doLast {
        copy { // copy generated swaggerUI to resource path 
            from outputDir.toPath() // 만들어진 위치
            into "src/main/resources/static/docs/" // 복사할 위치
        }
    }
}

build { // 빌드할 때 UI가 만들어지도록
    dependsOn generateSwaggerUI
}

bootJar { // jar 압축 때 UI가 만들어지도록
    dependsOn generateSwaggerUI
}

🙋🏻 More

아름다움

image

@kyY00n kyY00n marked this pull request as ready for review July 20, 2023 08:24
@kyY00n kyY00n changed the title Feature/#34 swaggerUI Jul 20, 2023
Copy link
Collaborator

@iamjooon2 iamjooon2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

정말 고생많으셨어요!

로지 최고

Copy link
Collaborator

@wonyongChoi05 wonyongChoi05 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

@iamjooon2 iamjooon2 changed the title swaggerUI Swagger + RestDocs 설정 Jul 22, 2023
@iamjooon2 iamjooon2 changed the title Swagger + RestDocs 설정 Swagger UI 설정 Jul 22, 2023
Copy link
Member

@parkmuhyeun parkmuhyeun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

동시 적용하느라 수고했으 👍🏻

@kyY00n kyY00n merged commit f427825 into develop Jul 24, 2023
@kyY00n kyY00n deleted the feature/#34 branch July 24, 2023 05:01
kyY00n added a commit that referenced this pull request Jul 25, 2023
* feat: restdocs + swagger 설정

* fix: 의존성 수정 및 명세 추가

* fix: docs 삭제 task 실행 순서

* feat: 생성한 문서를 정적리소스 위치로 복사

* feat: UI 생성 테스크를 bootJar 태스크에 포함

* fix: 빌드 스크립트 순서 조정

* feat: 문서에 예외 응답 추가

* chore: 문서를 버전관리에서 제외

* chore: given when then 주석

* chore: var 통일

---------

Co-authored-by: wonyongChoi05 <rltgjqmduftlagl@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API 명세 툴 도입
4 participants