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

๐Ÿš€ Restdocs๋ฅผ ํ™œ์šฉํ•œ #OOTW API ๋ช…์„ธ์„œ ์ž‘์„ฑ #75

Merged
merged 32 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
0c518f8
test: ํ•„์š”์—†๋Š” ๋ฉ”์„œ๋“œ ์ œ๊ฑฐ
ASak1104 Jan 17, 2024
3d5b136
chore: restdocs gradle task ์„ค์ •
ASak1104 Jan 17, 2024
1113539
test: user document test ์ถ”๊ฐ€
ASak1104 Jan 17, 2024
f2e093d
docs: restdocs index ํŒŒ์ผ ์ถ”๊ฐ€
ASak1104 Jan 17, 2024
9d83e22
test: certificate document test ์ถ”๊ฐ€
ASak1104 Jan 17, 2024
4a128c4
docs: certificate api docs ์ถ”๊ฐ€
ASak1104 Jan 17, 2024
0fc9844
test: avatar image documentation test ์ถ”๊ฐ€
ASak1104 Jan 17, 2024
e28b5bb
docs: avatar image api docs ์ถ”๊ฐ€
ASak1104 Jan 17, 2024
1d3d463
test: avatar image upload test์— token ์„ค์ • ์ถ”๊ฐ€
ASak1104 Jan 17, 2024
3607561
docs: avatar image upload header ์ถ”๊ฐ€
ASak1104 Jan 17, 2024
29c0afd
style: fix typo
ASak1104 Jan 17, 2024
bc95393
style: ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” import ๋ฌธ ์ œ๊ฑฐ
ASak1104 Jan 17, 2024
a20d575
test: post like documentation test ์ถ”๊ฐ€
ASak1104 Jan 17, 2024
4241470
docs: post like api docs ์ถ”๊ฐ€
ASak1104 Jan 17, 2024
87248d8
test: weather documentation test ์ถ”๊ฐ€
ASak1104 Jan 17, 2024
d23d850
docs: weather api docs ์ถ”๊ฐ€
ASak1104 Jan 17, 2024
bc378e7
style: rename weather documentation test class
ASak1104 Jan 17, 2024
90bf6e8
test: post create documentation test ์ถ”๊ฐ€
ASak1104 Jan 17, 2024
37bfa28
test: post read detail documentation test ์ถ”๊ฐ€
ASak1104 Jan 17, 2024
895ca93
test: post read all documentation test ์ถ”๊ฐ€
ASak1104 Jan 17, 2024
35e65bf
test: post update documentation test ์ถ”๊ฐ€
ASak1104 Jan 17, 2024
f248e0e
test: post delete documentation test ์ถ”๊ฐ€
ASak1104 Jan 17, 2024
3d7b012
docs: post create api docs ์ถ”๊ฐ€
ASak1104 Jan 17, 2024
c659ea9
docs: post read detail api docs ์ถ”๊ฐ€
ASak1104 Jan 17, 2024
be5e6b6
docs: post read all api docs ์ถ”๊ฐ€
ASak1104 Jan 17, 2024
c246a26
test: ๋ˆ„๋ฝ๋œ update request ํ•„๋“œ ์ถ”๊ฐ€
ASak1104 Jan 17, 2024
149db1e
docs: post update api docs ์ถ”๊ฐ€
ASak1104 Jan 17, 2024
377b8b0
docs: post delete documentation test ์ถ”๊ฐ€
ASak1104 Jan 17, 2024
6a33828
docs: ootw api document index ํŒŒ์ผ
ASak1104 Jan 17, 2024
3dc67a2
docs: ํ˜„์žฌ ๊ธฐ์˜จ ์กฐํšŒ๋ฅผ ํ˜„์žฌ ๋‚ ์”จ ์กฐํšŒ๋กœ ๋ณ€๊ฒฝ
ASak1104 Jan 18, 2024
049cfa1
test: set post read token header to optional
ASak1104 Jan 18, 2024
45448b3
docs: token header์— ๋Œ€ํ•œ optional ์ปฌ๋Ÿผ ์ถ”๊ฐ€
ASak1104 Jan 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id 'org.springframework.boot' version '3.2.0'
id 'io.spring.dependency-management' version '1.1.4'
id 'org.asciidoctor.jvm.convert' version '4.0.1'
id 'java'
id 'jacoco'
id 'checkstyle'
Expand Down Expand Up @@ -48,15 +49,23 @@ dependencies {
testImplementation 'com.icegreen:greenmail-junit5:2.0.1'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
testImplementation 'org.springframework.restdocs:spring-restdocs-asciidoctor'
}

jacoco {
toolVersion = "0.8.11"
}

ext {
snippetsDir = file('build/generated-snippets')
}

test {
useJUnitPlatform()
outputs.dir snippetsDir

finalizedBy asciidoctor
finalizedBy jacocoTestReport
}

Expand Down Expand Up @@ -103,6 +112,7 @@ jacocoTestCoverageVerification {
}
}
}

dependsOn jacocoTestReport
}

Expand All @@ -114,3 +124,22 @@ checkstyle {
"org.checkstyle.google.suppressionxpathfilter.config": "suppressions.xml"
]
}

asciidoctor {
inputs.dir snippetsDir
outputDir 'src/docs/asciidoc'
sources {
include 'index.adoc'
}

dependsOn test
}

bootJar {
copy {
from "${asciidoctor.outputDir}"
into 'build/static/docs'
}

dependsOn asciidoctor
}
296 changes: 296 additions & 0 deletions src/docs/asciidoc/index.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,296 @@
ifndef::snippets[]
:snippets: build/generated-snippets
endif::[]

= #OOTW API Documentation
Doc Writers - ๊น€ํ˜„์šฐ
:doctype: book
:icons: font
:source-highlighter: highlightjs
:toc: left
:toclevels: 2
:sectlinks:

= User API

'''
== signup

NOTE: ์‚ฌ์šฉ์ž ํšŒ์›๊ฐ€์ž…

=== Request

include::{snippets}/user-signup/request-body.adoc[]
include::{snippets}/user-signup/request-fields.adoc[]

==== Request example

include::{snippets}/user-signup/http-request.adoc[]

=== Response

==== Response example

include::{snippets}/user-signup/http-response.adoc[]

== login

NOTE: ์‚ฌ์šฉ์ž ๋กœ๊ทธ์ธ

=== Request

include::{snippets}/user-login/request-body.adoc[]
include::{snippets}/user-login/request-fields.adoc[]

==== Request example

include::{snippets}/user-login/http-request.adoc[]

=== Response

include::{snippets}/user-login/response-body.adoc[]
include::{snippets}/user-login/response-fields.adoc[]

==== Response example

include::{snippets}/user-login/http-response.adoc[]

== certificate

NOTE: ์ด๋ฉ”์ผ ์ธ์ฆ ์ฝ”๋“œ ๋ฐœ์†ก

=== Request

include::{snippets}/certificate/query-parameters.adoc[]

==== Request example

include::{snippets}/certificate/http-request.adoc[]

=== Response

==== Response example

include::{snippets}/certificate/http-response.adoc[]

== certify

NOTE: ์ด๋ฉ”์ผ ์ธ์ฆ

=== Request

include::{snippets}/certify/query-parameters.adoc[]

==== Request example

include::{snippets}/certify/http-request.adoc[]

=== Response

==== Response example

include::{snippets}/certify/http-response.adoc[]

= Avatar Item API

'''
== upload

NOTE: ์•„๋ฐ”ํƒ€ ์ด๋ฏธ์ง€ ์—…๋กœ๋“œ

=== Request

include::{snippets}/avatar-image-upload/request-headers.adoc[]
include::{snippets}/avatar-image-upload/request-parts.adoc[]
include::{snippets}/avatar-image-upload/request-part-request-fields.adoc[]

==== Request example

include::{snippets}/avatar-image-upload/http-request.adoc[]

=== Response

include::{snippets}/avatar-image-upload/response-body.adoc[]
include::{snippets}/avatar-image-upload/response-fields.adoc[]

==== Response example

include::{snippets}/avatar-image-upload/http-response.adoc[]

== get all

NOTE: ์ „์ฒด ์•„๋ฐ”ํƒ€ ์ด๋ฏธ์ง€ ์กฐํšŒ

=== Request

==== Request example

include::{snippets}/avatar-image-get-all/http-request.adoc[]

=== Response

include::{snippets}/avatar-image-get-all/response-body.adoc[]
include::{snippets}/avatar-image-get-all/response-fields.adoc[]

==== Response example

include::{snippets}/avatar-image-get-all/http-response.adoc[]

= Post API

'''
== post create

NOTE: ๊ฒŒ์‹œ๊ธ€ ์ƒ์„ฑ

=== Request

include::{snippets}/post-create/request-headers.adoc[]
include::{snippets}/post-create/request-parts.adoc[]
include::{snippets}/post-create/request-part-request-fields.adoc[]

==== Request example

include::{snippets}/post-create/http-request.adoc[]

=== Response

include::{snippets}/post-create/response-body.adoc[]
include::{snippets}/post-create/response-fields.adoc[]

==== Response example

include::{snippets}/post-create/http-response.adoc[]

== post read detail

NOTE: ๊ฒŒ์‹œ๊ธ€ ์ƒ์„ธ ์กฐํšŒ

=== Request

include::{snippets}/post-read-detail/request-headers.adoc[]
include::{snippets}/post-read-detail/path-parameters.adoc[]

==== Request example

include::{snippets}/post-read-detail/http-request.adoc[]

=== Response

include::{snippets}/post-read-detail/response-body.adoc[]
include::{snippets}/post-read-detail/response-fields.adoc[]

==== Response example

include::{snippets}/post-read-detail/http-response.adoc[]

== post read all

NOTE: ๊ฒŒ์‹œ๊ธ€ ์ „์ฒด ์กฐํšŒ

=== Request

include::{snippets}/post-read-all/request-headers.adoc[]

==== Request example

include::{snippets}/post-read-all/http-request.adoc[]

=== Response

include::{snippets}/post-read-all/response-body.adoc[]
include::{snippets}/post-read-all/response-fields.adoc[]

==== Response example

include::{snippets}/post-read-all/http-response.adoc[]

== post update

NOTE: ๊ฒŒ์‹œ๊ธ€ ๋ณ€๊ฒฝ

=== Request

include::{snippets}/post-update/request-headers.adoc[]
include::{snippets}/post-update/request-parts.adoc[]
include::{snippets}/post-update/request-part-request-fields.adoc[]

==== Request example

include::{snippets}/post-update/http-request.adoc[]

=== Response

include::{snippets}/post-update/response-body.adoc[]
include::{snippets}/post-update/response-fields.adoc[]

==== Response example

include::{snippets}/post-update/http-response.adoc[]

== post delete

NOTE: ๊ฒŒ์‹œ๊ธ€ ์‚ญ์ œ

=== Request

include::{snippets}/post-delete/request-headers.adoc[]
include::{snippets}/post-delete/path-parameters.adoc[]

==== Request example

include::{snippets}/post-delete/http-request.adoc[]

=== Response

==== Response example

include::{snippets}/post-delete/http-response.adoc[]

== like push

NOTE: ๊ฒŒ์‹œ๊ธ€ ์ข‹์•„์š”

=== Request

include::{snippets}/like-push/request-headers.adoc[]
include::{snippets}/like-push/request-body.adoc[]
include::{snippets}/like-push/request-fields.adoc[]

==== Request example

include::{snippets}/like-push/http-request.adoc[]

=== Response

include::{snippets}/like-push/response-body.adoc[]
include::{snippets}/like-push/response-fields.adoc[]

==== Response example

include::{snippets}/like-push/http-response.adoc[]

= Weather API

'''
== current weather

NOTE: ํ˜„์žฌ ๋‚ ์”จ ์กฐํšŒ

=== Request

include::{snippets}/weather/request-headers.adoc[]
include::{snippets}/weather/query-parameters.adoc[]

==== Request example

include::{snippets}/weather/http-request.adoc[]

=== Response

include::{snippets}/weather/response-body.adoc[]
include::{snippets}/weather/response-fields.adoc[]

==== Response example

include::{snippets}/weather/http-response.adoc[]
Loading
Loading