From a5c31e85e5a2a2927e8667045c1b47d560aafa29 Mon Sep 17 00:00:00 2001 From: Ethan Date: Tue, 15 Aug 2023 17:28:38 +0900 Subject: [PATCH] =?UTF-8?q?Restdocs=EA=B0=80=20build=20=ED=8C=8C=EC=9D=BC?= =?UTF-8?q?=EC=97=90=20=EC=83=9D=EC=84=B1=EC=9D=B4=20=EB=90=98=EC=A7=80=20?= =?UTF-8?q?=EC=95=8A=EB=8D=98=20=EB=AC=B8=EC=A0=9C=20=EC=88=98=EC=A0=95=20?= =?UTF-8?q?(#359)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: gradle task 순서 변경 및 공통 경로 상수화 * docs: adoc 파일 snippet 경로 수정 * docs: adoc 파일 depth 변경 --- backend/baton/build.gradle | 12 ++++----- .../asciidoc/MemberLoginProfileReadApi.adoc | 8 +++--- .../asciidoc/RunnerLoginProfileReadApi.adoc | 8 +++--- .../src/docs/asciidoc/RunnerPostReadApi.adoc | 18 ++++++------- ...nnerPostUpdateApplicantCancelationApi.adoc | 26 +++++++++---------- .../docs/asciidoc/RunnerProfileReadApi.adoc | 24 +++-------------- .../docs/asciidoc/RunnerProfileUpdateApi.adoc | 26 +++++++++---------- .../asciidoc/SupporterProfileReadApi.adoc | 22 ++++++++-------- .../asciidoc/SupporterProfileUpdateApi.adoc | 10 +++---- backend/baton/src/docs/asciidoc/index.adoc | 1 - 10 files changed, 67 insertions(+), 88 deletions(-) diff --git a/backend/baton/build.gradle b/backend/baton/build.gradle index d787ab6a7..73b46e18b 100644 --- a/backend/baton/build.gradle +++ b/backend/baton/build.gradle @@ -29,6 +29,8 @@ repositories { ext { set('snippetsDir', file("build/generated-snippets")) + set('restDocsCopyFrom', 'build/docs/asciidoc') + set('restDocsCopyInto', 'src/main/resources/static/docs') } dependencies { @@ -81,15 +83,13 @@ tasks.named('asciidoctor') { } asciidoctor.doFirst { - delete file('src/main/resources/static/docs') + delete file(restDocsCopyFrom) } task copyDocument(type: Copy) { dependsOn asciidoctor - from file('build/docs/asciidoc') - into file('src/main/resources/static/docs') + from file(restDocsCopyFrom) + into file(restDocsCopyInto) } -build { - dependsOn copyDocument -} +bootJar.dependsOn('copyDocument') diff --git a/backend/baton/src/docs/asciidoc/MemberLoginProfileReadApi.adoc b/backend/baton/src/docs/asciidoc/MemberLoginProfileReadApi.adoc index c96112740..383cc4389 100644 --- a/backend/baton/src/docs/asciidoc/MemberLoginProfileReadApi.adoc +++ b/backend/baton/src/docs/asciidoc/MemberLoginProfileReadApi.adoc @@ -16,16 +16,16 @@ endif::[] ===== *Http Request* -include::{snippets}/../../build/generated-snippets/member-login-profile-read-api-test/read-login-member-by-access-token/http-request.adoc[] +include::{snippets}/../../build/generated-snippets/member-read-with-logined-member-api-test/read-login-member-by-access-token/http-request.adoc[] ===== *Http Request Headers* -include::{snippets}/../../build/generated-snippets/member-login-profile-read-api-test/read-login-member-by-access-token/request-headers.adoc[] +include::{snippets}/../../build/generated-snippets/member-read-with-logined-member-api-test/read-login-member-by-access-token/request-headers.adoc[] ===== *Http Response* -include::{snippets}/../../build/generated-snippets/member-login-profile-read-api-test/read-login-member-by-access-token/http-response.adoc[] +include::{snippets}/../../build/generated-snippets/member-read-with-logined-member-api-test/read-login-member-by-access-token/http-response.adoc[] ===== *Http Response Fields* -include::{snippets}/../../build/generated-snippets/member-login-profile-read-api-test/read-login-member-by-access-token/response-fields.adoc[] +include::{snippets}/../../build/generated-snippets/member-read-with-logined-member-api-test/read-login-member-by-access-token/response-fields.adoc[] diff --git a/backend/baton/src/docs/asciidoc/RunnerLoginProfileReadApi.adoc b/backend/baton/src/docs/asciidoc/RunnerLoginProfileReadApi.adoc index 588a8552c..6e61a6325 100644 --- a/backend/baton/src/docs/asciidoc/RunnerLoginProfileReadApi.adoc +++ b/backend/baton/src/docs/asciidoc/RunnerLoginProfileReadApi.adoc @@ -16,16 +16,16 @@ endif::[] ===== *Http Request* -include::{snippets}/../../build/generated-snippets/runner-profile-read-api-test/read-my-profile-by-token/http-request.adoc[] +include::{snippets}/../../build/generated-snippets/runner-read-with-logined-runner-api-test/read-my-profile-by-token/http-request.adoc[] ===== *Http Request Headers* -include::{snippets}/../../build/generated-snippets/runner-profile-read-api-test/read-my-profile-by-token/request-headers.adoc[] +include::{snippets}/../../build/generated-snippets/runner-read-with-logined-runner-api-test/read-my-profile-by-token/request-headers.adoc[] ===== *Http Response* -include::{snippets}/../../build/generated-snippets/runner-profile-read-api-test/read-my-profile-by-token/http-response.adoc[] +include::{snippets}/../../build/generated-snippets/runner-read-with-logined-runner-api-test/read-my-profile-by-token/http-response.adoc[] ===== *Http Response Fields* -include::{snippets}/../../build/generated-snippets/runner-profile-read-api-test/read-my-profile-by-token/response-fields.adoc[] +include::{snippets}/../../build/generated-snippets/runner-read-with-logined-runner-api-test/read-my-profile-by-token/response-fields.adoc[] diff --git a/backend/baton/src/docs/asciidoc/RunnerPostReadApi.adoc b/backend/baton/src/docs/asciidoc/RunnerPostReadApi.adoc index f5ed68728..052d8c684 100644 --- a/backend/baton/src/docs/asciidoc/RunnerPostReadApi.adoc +++ b/backend/baton/src/docs/asciidoc/RunnerPostReadApi.adoc @@ -16,19 +16,19 @@ endif::[] ===== *Http Request* -include::{snippets}/../../build/generated-snippets/runner-post-read-api-test/read-referenced-by-supporter/http-request.adoc[] +include::{snippets}/../../build/generated-snippets/runner-post-read-all-api-test/read-referenced-by-supporter/http-request.adoc[] ===== *Http Request Query Parameters* -include::{snippets}/../../build/generated-snippets/runner-post-read-api-test/read-referenced-by-supporter/query-parameters.adoc[] +include::{snippets}/../../build/generated-snippets/runner-post-read-all-api-test/read-referenced-by-supporter/query-parameters.adoc[] ===== *Http Response* -include::{snippets}/../../build/generated-snippets/runner-post-read-api-test/read-referenced-by-supporter/http-response.adoc[] +include::{snippets}/../../build/generated-snippets/runner-post-read-all-api-test/read-referenced-by-supporter/http-response.adoc[] ===== *Http Response Fields* -include::{snippets}/../../build/generated-snippets/runner-post-read-api-test/read-referenced-by-supporter/response-fields.adoc[] +include::{snippets}/../../build/generated-snippets/runner-post-read-all-api-test/read-referenced-by-supporter/response-fields.adoc[] === *러너 게시글 상세 조회* @@ -36,20 +36,20 @@ include::{snippets}/../../build/generated-snippets/runner-post-read-api-test/rea ===== *Http Request* -include::{snippets}/../../build/generated-snippets/runner-post-read-api-test/read-by-runner-post-id/http-request.adoc[] +include::{snippets}/../../build/generated-snippets/runner-post-read-all-api-test/read-by-runner-post-id/http-request.adoc[] ===== *Http Request Headers -include::{snippets}/../../build/generated-snippets/runner-post-read-api-test/read-by-runner-post-id/request-headers.adoc[] +include::{snippets}/../../build/generated-snippets/runner-post-read-all-api-test/read-by-runner-post-id/request-headers.adoc[] ===== *Http Request Path Parameters* -include::{snippets}/../../build/generated-snippets/runner-post-read-api-test/read-by-runner-post-id/path-parameters.adoc[] +include::{snippets}/../../build/generated-snippets/runner-post-read-all-api-test/read-by-runner-post-id/path-parameters.adoc[] ===== *Http Response* -include::{snippets}/../../build/generated-snippets/runner-post-read-api-test/read-by-runner-post-id/http-response.adoc[] +include::{snippets}/../../build/generated-snippets/runner-post-read-all-api-test/read-by-runner-post-id/http-response.adoc[] ===== *Http Response Fields* -include::{snippets}/../../build/generated-snippets/runner-post-read-api-test/read-by-runner-post-id/response-fields.adoc[] +include::{snippets}/../../build/generated-snippets/runner-post-read-all-api-test/read-by-runner-post-id/response-fields.adoc[] diff --git a/backend/baton/src/docs/asciidoc/RunnerPostUpdateApplicantCancelationApi.adoc b/backend/baton/src/docs/asciidoc/RunnerPostUpdateApplicantCancelationApi.adoc index 2d9c2cfe2..af18a44d7 100644 --- a/backend/baton/src/docs/asciidoc/RunnerPostUpdateApplicantCancelationApi.adoc +++ b/backend/baton/src/docs/asciidoc/RunnerPostUpdateApplicantCancelationApi.adoc @@ -5,31 +5,29 @@ endif::[] :icons: font :source-highlighter: highlight.js :toc: left -:toclevels: 2 +:toclevels: 3 :sectlinks: :operation-http-request-title: Example Request :operation-http-response-title: Example Response -== *서포터의 러너 게시글 리뷰 제안 철회* +==== *서포터의 러너 게시글 리뷰 제안 철회 API* -=== *서포터의 러너 게시글 리뷰 제안 철회 API* +===== *Http Request* -==== *Http Request* +include::{snippets}/../../build/generated-snippets/runner-post-update-applicant-cancelation-api-test/update-supporter-cancel-runner-post/http-request.adoc[] -include::{snippets}/../../build/generated-snippets/runner-post-update-supporter-cancelation-api-test/update-supporter-cancel-runner-post/http-request.adoc[] +===== *Http Request Headers* -==== *Http Request Headers* +include::{snippets}/../../build/generated-snippets/runner-post-update-applicant-cancelation-api-test/update-supporter-cancel-runner-post/request-headers.adoc[] -include::{snippets}/../../build/generated-snippets/runner-post-update-supporter-cancelation-api-test/update-supporter-cancel-runner-post/request-headers.adoc[] +===== *Http Path Parameters* -==== *Http Path Parameters* +include::{snippets}/../../build/generated-snippets/runner-post-update-applicant-cancelation-api-test/update-supporter-cancel-runner-post/path-parameters.adoc[] -include::{snippets}/../../build/generated-snippets/runner-post-update-supporter-cancelation-api-test/update-supporter-cancel-runner-post/path-parameters.adoc[] +===== *Http Response* -==== *Http Response* +include::{snippets}/../../build/generated-snippets/runner-post-update-applicant-cancelation-api-test/update-supporter-cancel-runner-post/http-response.adoc[] -include::{snippets}/../../build/generated-snippets/runner-post-update-supporter-cancelation-api-test/update-supporter-cancel-runner-post/http-response.adoc[] +===== *Http Response Headers* -==== *Http Response Headers* - -include::{snippets}/../../build/generated-snippets/runner-post-update-supporter-cancelation-api-test/update-supporter-cancel-runner-post/response-headers.adoc[] +include::{snippets}/../../build/generated-snippets/runner-post-update-applicant-cancelation-api-test/update-supporter-cancel-runner-post/response-headers.adoc[] diff --git a/backend/baton/src/docs/asciidoc/RunnerProfileReadApi.adoc b/backend/baton/src/docs/asciidoc/RunnerProfileReadApi.adoc index 11ae7c6ec..91f129c0c 100644 --- a/backend/baton/src/docs/asciidoc/RunnerProfileReadApi.adoc +++ b/backend/baton/src/docs/asciidoc/RunnerProfileReadApi.adoc @@ -16,30 +16,12 @@ endif::[] ===== *Http Request* -include::{snippets}/../../build/generated-snippets/runner-profile-read-api-test/read-runner-profile/http-request.adoc[] +include::{snippets}/../../build/generated-snippets/runner-read-by-runner-id-api-test/read-runner-profile/http-request.adoc[] ===== *Http Response* -include::{snippets}/../../build/generated-snippets/runner-profile-read-api-test/read-runner-profile/http-response.adoc[] +include::{snippets}/../../build/generated-snippets/runner-read-by-runner-id-api-test/read-runner-profile/http-response.adoc[] ===== *Http Response Fields* -include::{snippets}/../../build/generated-snippets/runner-profile-read-api-test/read-runner-profile/response-fields.adoc[] - -==== *러너 마이페이지 프로필 조회 API* - -===== *Http Request* - -include::{snippets}/../../build/generated-snippets/runner-profile-read-api-test/read-my-profile-by-token/http-request.adoc[] - -===== *Http Request Headers* - -include::{snippets}/../../build/generated-snippets/runner-profile-read-api-test/read-my-profile-by-token/request-headers.adoc[] - -===== *Http Response* - -include::{snippets}/../../build/generated-snippets/runner-profile-read-api-test/read-my-profile-by-token/http-response.adoc[] - -===== *Http Response Fields* - -include::{snippets}/../../build/generated-snippets/runner-profile-read-api-test/read-my-profile-by-token/response-fields.adoc[] +include::{snippets}/../../build/generated-snippets/runner-read-by-runner-id-api-test/read-runner-profile/response-fields.adoc[] diff --git a/backend/baton/src/docs/asciidoc/RunnerProfileUpdateApi.adoc b/backend/baton/src/docs/asciidoc/RunnerProfileUpdateApi.adoc index a831018a5..f38411b62 100644 --- a/backend/baton/src/docs/asciidoc/RunnerProfileUpdateApi.adoc +++ b/backend/baton/src/docs/asciidoc/RunnerProfileUpdateApi.adoc @@ -5,31 +5,31 @@ endif::[] :icons: font :source-highlighter: highlight.js :toc: left -:toclevels: 2 +:toclevels: 3 :sectlinks: :operation-http-request-title: Example Request :operation-http-response-title: Example Response -== *러너 프로필 수정* +=== *러너 프로필 수정* -=== *러너 프로필 수정 API* +==== *러너 프로필 수정 API* -==== *Http Request* +===== *Http Request* -include::{snippets}/../../build/generated-snippets/runner-profile-update-api-test/update-runner-profile/http-request.adoc[] +include::{snippets}/../../build/generated-snippets/runner-update-api-test/update-runner-profile/http-request.adoc[] -==== *Http Request Headers* +===== *Http Request Headers* -include::{snippets}/../../build/generated-snippets/runner-profile-update-api-test/update-runner-profile/request-headers.adoc[] +include::{snippets}/../../build/generated-snippets/runner-update-api-test/update-runner-profile/request-headers.adoc[] -==== *Http Request Body* +===== *Http Request Body* -include::{snippets}/../../build/generated-snippets/runner-profile-update-api-test/update-runner-profile/request-body.adoc[] +include::{snippets}/../../build/generated-snippets/runner-update-api-test/update-runner-profile/request-body.adoc[] -==== *Http Response* +===== *Http Response* -include::{snippets}/../../build/generated-snippets/runner-profile-update-api-test/update-runner-profile/http-response.adoc[] +include::{snippets}/../../build/generated-snippets/runner-update-api-test/update-runner-profile/http-response.adoc[] -==== *Http Response Headers* +===== *Http Response Headers* -include::{snippets}/../../build/generated-snippets/runner-profile-update-api-test/update-runner-profile/response-headers.adoc[] +include::{snippets}/../../build/generated-snippets/runner-update-api-test/update-runner-profile/response-headers.adoc[] diff --git a/backend/baton/src/docs/asciidoc/SupporterProfileReadApi.adoc b/backend/baton/src/docs/asciidoc/SupporterProfileReadApi.adoc index 13f6228f1..4534bf940 100644 --- a/backend/baton/src/docs/asciidoc/SupporterProfileReadApi.adoc +++ b/backend/baton/src/docs/asciidoc/SupporterProfileReadApi.adoc @@ -5,27 +5,27 @@ endif::[] :icons: font :source-highlighter: highlight.js :toc: left -:toclevels: 2 +:toclevels: 3 :sectlinks: :operation-http-request-title: Example Request :operation-http-response-title: Example Response -== *서포터 프로필 조회* +=== *서포터 프로필 조회* -=== *서포터 마이페이지 프로필 조회 API* +==== *서포터 마이페이지 프로필 조회 API* -==== *Http Request* +===== *Http Request* -include::{snippets}/../../build/generated-snippets/supporter-profile-read-api-test/read-my-profile-by-token/http-request.adoc[] +include::{snippets}/../../build/generated-snippets/supporter-read-by-guest-api-test/read-my-profile-by-token/http-request.adoc[] -==== *Http Request Headers* +===== *Http Request Headers* -include::{snippets}/../../build/generated-snippets/supporter-profile-read-api-test/read-my-profile-by-token/request-headers.adoc[] +include::{snippets}/../../build/generated-snippets/supporter-read-by-guest-api-test/read-my-profile-by-token/request-headers.adoc[] -==== *Http Response* +===== *Http Response* -include::{snippets}/../../build/generated-snippets/supporter-profile-read-api-test/read-my-profile-by-token/http-response.adoc[] +include::{snippets}/../../build/generated-snippets/supporter-read-by-guest-api-test/read-my-profile-by-token/http-response.adoc[] -==== *Http Response Fields* +===== *Http Response Fields* -include::{snippets}/../../build/generated-snippets/supporter-profile-read-api-test/read-my-profile-by-token/response-fields.adoc[] +include::{snippets}/../../build/generated-snippets/supporter-read-by-guest-api-test/read-my-profile-by-token/response-fields.adoc[] diff --git a/backend/baton/src/docs/asciidoc/SupporterProfileUpdateApi.adoc b/backend/baton/src/docs/asciidoc/SupporterProfileUpdateApi.adoc index 6c40d3e01..edc8c7c7f 100644 --- a/backend/baton/src/docs/asciidoc/SupporterProfileUpdateApi.adoc +++ b/backend/baton/src/docs/asciidoc/SupporterProfileUpdateApi.adoc @@ -16,20 +16,20 @@ endif::[] ===== *Http Request* -include::{snippets}/../../build/generated-snippets/supporter-profile-update-api-test/update-supporter-profile/http-request.adoc[] +include::{snippets}/../../build/generated-snippets/supporter-update-api-test/update-supporter-profile/http-request.adoc[] ===== *Http Request Headers* -include::{snippets}/../../build/generated-snippets/supporter-profile-update-api-test/update-supporter-profile/request-headers.adoc[] +include::{snippets}/../../build/generated-snippets/supporter-update-api-test/update-supporter-profile/request-headers.adoc[] ===== *Http Request Body* -include::{snippets}/../../build/generated-snippets/supporter-profile-update-api-test/update-supporter-profile/request-body.adoc[] +include::{snippets}/../../build/generated-snippets/supporter-update-api-test/update-supporter-profile/request-body.adoc[] ===== *Http Response* -include::{snippets}/../../build/generated-snippets/supporter-profile-update-api-test/update-supporter-profile/http-response.adoc[] +include::{snippets}/../../build/generated-snippets/supporter-update-api-test/update-supporter-profile/http-response.adoc[] ===== *Http Response Headers* -include::{snippets}/../../build/generated-snippets/supporter-profile-update-api-test/update-supporter-profile/response-headers.adoc[] +include::{snippets}/../../build/generated-snippets/supporter-update-api-test/update-supporter-profile/response-headers.adoc[] diff --git a/backend/baton/src/docs/asciidoc/index.adoc b/backend/baton/src/docs/asciidoc/index.adoc index 013f81fe8..7cc650dc9 100644 --- a/backend/baton/src/docs/asciidoc/index.adoc +++ b/backend/baton/src/docs/asciidoc/index.adoc @@ -32,6 +32,5 @@ include::RunnerPostCreateApi.adoc[] == *[ 서포터 ]* include::SupporterProfileReadApi.adoc[] - include::SupporterProfileUpdateApi.adoc[] include::RunnerPostUpdateApi.adoc[]