21. Spring Auto REST Docs
について
21
聴講セッション
Introducing Spring Auto REST Docs
by Florian Benz @ScalableCapital
https://www.slideshare.net/fbenz/introducing-spring-auto-rest-docs
30. デフォルトで生成されるスニペット
• curl-request.adoc
• http-request.adoc
• http-response.adoc
• httpie-request.adoc
• request-body.adoc
• response-body.adoc
生成されるスニペット
30
[source,bash]
----
$ curl 'http://localhost:8080/tags' -i -X POST
-H 'Content-Type: application/hal+json'
-d '{
"name" : "REST"
}'
----
|===
|Path|Type|Description
|`name`
|`String`
|The name of the tag
|===
[source,http,options="nowrap"]
----
HTTP/1.1 201 Created
Location: http://localhost:8080/tags/7
----
curl-request.adoc
request-fields.adoc
http-response.adoc
31. 31
[[resources-tags-create]]
=== Creating a tag
A `POST` request is used to create a note
operation::tags-create-example[snippets='request-
fields,curl-request,http-response']
[[resources-note]]
== Note
The Note resource is used to retrieve, update, and
delete individual notes
[[resources-note-links]]
=== Links
include::{snippets}/note-get-example/links.adoc[]
スニペットをまとめる
snippet.adoc
まとめ.adoc
snippet.adoc
snippet.adoc
snippet.adoc
You can change the default snippet configuration during setup using the RestDocumentationConfigurer API. For example, to only produce the curl-request snippet by default: