@@ -449,6 +449,7 @@ <h1>Example API Documentation</h1>
449449< li > < a href ="#resources-item-resource-test-process-single-item "> 2.9. Process One Item</ a > </ li >
450450< li > < a href ="#resources-item-resource-test-validate-metadata "> 2.10. Validate Metadata</ a > </ li >
451451< li > < a href ="#resources-item-resource-test-clone-item "> 2.11. Clone Item (deprecated)</ a > </ li >
452+ < li > < a href ="#resources-items-get-spring-rest-docs "> 2.12. Get an item (SARD/SRD mix)</ a > </ li >
452453</ ul >
453454</ li >
454455</ ul >
@@ -1121,7 +1122,7 @@ <h4 id="_example_request"><a class="anchor" href="#_example_request"></a><a clas
11211122< div class ="content ">
11221123< pre class ="highlightjs highlight "> < code class ="language-bash " data-lang ="bash "> $ curl 'http://localhost:8080/items' -i -X POST \
11231124 -H 'Content-Type: application/json' \
1124- -H 'Authorization: Bearer 5ce7867e-0458-4378-8b94-a7133a194e47 ' \
1125+ -H 'Authorization: Bearer 5594beae-01ec-412b-9169-b69c30696c18 ' \
11251126 -d '{"description":"Hot News"}'</ code > </ pre >
11261127</ div >
11271128</ div >
@@ -1358,7 +1359,7 @@ <h4 id="_example_request_2"><a class="anchor" href="#_example_request_2"></a><a
13581359< div class ="content ">
13591360< pre class ="highlightjs highlight "> < code class ="language-bash " data-lang ="bash "> $ curl 'http://localhost:8080/items/1' -i -X PUT \
13601361 -H 'Content-Type: application/json' \
1361- -H 'Authorization: Bearer 5ce7867e-0458-4378-8b94-a7133a194e47 ' \
1362+ -H 'Authorization: Bearer 5594beae-01ec-412b-9169-b69c30696c18 ' \
13621363 -d '{"description":"Hot News"}'</ code > </ pre >
13631364</ div >
13641365</ div >
@@ -1464,7 +1465,7 @@ <h4 id="_example_request_3"><a class="anchor" href="#_example_request_3"></a><a
14641465< div class ="listingblock ">
14651466< div class ="content ">
14661467< pre class ="highlightjs highlight "> < code class ="language-bash " data-lang ="bash "> $ curl 'http://localhost:8080/items/1' -i -X DELETE \
1467- -H 'Authorization: Bearer 5ce7867e-0458-4378-8b94-a7133a194e47 '</ code > </ pre >
1468+ -H 'Authorization: Bearer 5594beae-01ec-412b-9169-b69c30696c18 '</ code > </ pre >
14681469</ div >
14691470</ div >
14701471</ div >
@@ -1949,19 +1950,19 @@ <h4 id="_example_response_5"><a class="anchor" href="#_example_response_5"></a><
19491950 "page" : 0,
19501951 "size" : 20,
19511952 "sort" : null,
1952- "offset" : 0,
19531953 "pageNumber" : 0,
1954- "pageSize" : 20
1954+ "pageSize" : 20,
1955+ "offset" : 0
19551956 },
19561957 "total" : 1,
1957- "last" : true,
19581958 "totalPages" : 1,
1959+ "last" : true,
19591960 "totalElements" : 1,
1960- "size" : 20,
1961- "number" : 0,
19621961 "sort" : null,
19631962 "first" : true,
1964- "numberOfElements" : 1
1963+ "numberOfElements" : 1,
1964+ "size" : 20,
1965+ "number" : 0
19651966}</ code > </ pre >
19661967</ div >
19671968</ div >
@@ -2420,12 +2421,123 @@ <h4 id="_example_response_9"><a class="anchor" href="#_example_response_9"></a><
24202421</ div >
24212422</ div >
24222423</ div >
2424+ < div class ="sect2 ">
2425+ < h3 id ="resources-items-get-spring-rest-docs "> < a class ="anchor " href ="#resources-items-get-spring-rest-docs "> </ a > < a class ="link " href ="#resources-items-get-spring-rest-docs "> 2.12. Get an item (SARD/SRD mix)</ a > </ h3 >
2426+ < div class ="paragraph ">
2427+ < p > This part of the documentation demonstrates the combination of Spring Auto REST Docs with Spring REST Docs:
2428+ The path parameter and response field are manually documented with Spring REST Docs.
2429+ The authorization is still coming from Spring Auto REST Docs and
2430+ the cURL and HTTP response are coming from Spring REST Docs in any case.</ p >
2431+ </ div >
2432+ < div class ="paragraph ">
2433+ < p > < code > GET /items/{id}</ code > </ p >
2434+ </ div >
2435+ < div class ="sect3 ">
2436+ < h4 id ="_authorization_12 "> < a class ="anchor " href ="#_authorization_12 "> </ a > < a class ="link " href ="#_authorization_12 "> 2.12.1. Authorization</ a > </ h4 >
2437+ < div class ="paragraph ">
2438+ < p > OAuth2: Resource is public.</ p >
2439+ </ div >
2440+ </ div >
2441+ < div class ="sect3 ">
2442+ < h4 id ="_path_parameters_11 "> < a class ="anchor " href ="#_path_parameters_11 "> </ a > < a class ="link " href ="#_path_parameters_11 "> 2.12.2. Path parameters</ a > </ h4 >
2443+ < table class ="tableblock frame-all grid-all spread ">
2444+ < caption class ="title "> Table 3. /items/{id}</ caption >
2445+ < colgroup >
2446+ < col style ="width: 50%; ">
2447+ < col style ="width: 50%; ">
2448+ </ colgroup >
2449+ < thead >
2450+ < tr >
2451+ < th class ="tableblock halign-left valign-top "> Parameter</ th >
2452+ < th class ="tableblock halign-left valign-top "> Description</ th >
2453+ </ tr >
2454+ </ thead >
2455+ < tbody >
2456+ < tr >
2457+ < td class ="tableblock halign-left valign-top "> < p class ="tableblock "> < code > id</ code > </ p > </ td >
2458+ < td class ="tableblock halign-left valign-top "> < p class ="tableblock "> ID of the item.</ p > </ td >
2459+ </ tr >
2460+ </ tbody >
2461+ </ table >
2462+ </ div >
2463+ < div class ="sect3 ">
2464+ < h4 id ="_response_fields_12 "> < a class ="anchor " href ="#_response_fields_12 "> </ a > < a class ="link " href ="#_response_fields_12 "> 2.12.3. Response fields</ a > </ h4 >
2465+ < table class ="tableblock frame-all grid-all spread ">
2466+ < colgroup >
2467+ < col style ="width: 33.3333%; ">
2468+ < col style ="width: 33.3333%; ">
2469+ < col style ="width: 33.3334%; ">
2470+ </ colgroup >
2471+ < thead >
2472+ < tr >
2473+ < th class ="tableblock halign-left valign-top "> Path</ th >
2474+ < th class ="tableblock halign-left valign-top "> Type</ th >
2475+ < th class ="tableblock halign-left valign-top "> Description</ th >
2476+ </ tr >
2477+ </ thead >
2478+ < tbody >
2479+ < tr >
2480+ < td class ="tableblock halign-left valign-top "> < p class ="tableblock "> < code > id</ code > </ p > </ td >
2481+ < td class ="tableblock halign-left valign-top "> < p class ="tableblock "> < code > String</ code > </ p > </ td >
2482+ < td class ="tableblock halign-left valign-top "> < p class ="tableblock "> There are more fields but only the ID field is documented.</ p > </ td >
2483+ </ tr >
2484+ </ tbody >
2485+ </ table >
2486+ </ div >
2487+ < div class ="sect3 ">
2488+ < h4 id ="_example_request_response_3 "> < a class ="anchor " href ="#_example_request_response_3 "> </ a > < a class ="link " href ="#_example_request_response_3 "> 2.12.4. Example request/response</ a > </ h4 >
2489+ < div class ="listingblock ">
2490+ < div class ="content ">
2491+ < pre class ="highlightjs highlight "> < code class ="language-bash " data-lang ="bash "> $ curl 'http://localhost:8080/items/1' -i</ code > </ pre >
2492+ </ div >
2493+ </ div >
2494+ < div class ="listingblock ">
2495+ < div class ="content ">
2496+ < pre class ="highlightjs highlight nowrap "> < code class ="language-http " data-lang ="http "> HTTP/1.1 200 OK
2497+ X-Content-Type-Options: nosniff
2498+ X-XSS-Protection: 1; mode=block
2499+ Cache-Control: no-cache, no-store, max-age=0, must-revalidate
2500+ Pragma: no-cache
2501+ Expires: 0
2502+ X-Frame-Options: DENY
2503+ Content-Type: application/json;charset=UTF-8
2504+ Content-Length: 459
2505+
2506+ {
2507+ "id" : "1",
2508+ "meta" : {
2509+ "type" : "1",
2510+ "tag" : "meta1"
2511+ },
2512+ "attributes" : {
2513+ "text" : "first item",
2514+ "number" : 1,
2515+ "bool" : true,
2516+ "decimal" : 1.11,
2517+ "amount" : "3.14 EUR",
2518+ "enumType" : "ONE"
2519+ },
2520+ "children" : [ {
2521+ "id" : "child-1",
2522+ "meta" : null,
2523+ "attributes" : null,
2524+ "children" : null,
2525+ "tags" : null,
2526+ "description" : "first child"
2527+ } ],
2528+ "tags" : [ "top-level" ],
2529+ "description" : "main item"
2530+ }</ code > </ pre >
2531+ </ div >
2532+ </ div >
2533+ </ div >
2534+ </ div >
24232535</ div >
24242536</ div >
24252537</ div >
24262538< div id ="footer ">
24272539< div id ="footer-text ">
2428- Last updated 2017-11-02 11:03:07 CET
2540+ Last updated 2018-01-06 21:26:54 CET
24292541</ div >
24302542</ div >
24312543< link rel ="stylesheet " href ="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.9.1/styles/github.min.css ">
0 commit comments