Newest api docs
This commit is contained in:
1 parent
91cdf15cc1
commit
83c519fdfd
2 files changed
+3
-3
No files matched your search
@@ -375,7 +375,7 @@ paths:
|
||||
summary: List users
|
||||
description: List all users.
|
||||
security:
|
||||
- BasicAuth: []
|
||||
- BasicAuth: [isAdmin]
|
||||
parameters:
|
||||
- in: query
|
||||
name: p
|
||||
@@ -407,7 +407,7 @@ paths:
|
||||
summary: Get user
|
||||
description: Get user by ID.
|
||||
security:
|
||||
- BasicAuth: [isAdmin]
|
||||
- BasicAuth: []
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
|
||||
@@ -506,7 +506,7 @@ data-styled.g137[id="sc-kvXgyf"]{content:"fBvPoH,"}/*!sc*/
|
||||
" class="sc-euGpHm sc-exayXG fwfkcU kqJXdD sc-dHrNzZ dRdjww"><p>User not found.</p>
|
||||
</div></button></div></div></div><div class="sc-iKTcqh sc-gnpbhQ fTxZsC drGLlX"><div class="sc-dKsqdn dCbPd"><button class="sc-iAlELC gsBSOU"><span type="delete" class="sc-oeqTF ByFMv http-verb delete">delete</span><span class="sc-eowDPD jcAXWA">/user/{id}</span><svg class="sc-cBYhjr iMxoRf" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-ezTrPE bFiOkX"><div class="sc-drnuxz hdRKqQ"><div html="" class="sc-euGpHm sc-exayXG fwfkcU jYGAQp"></div><div tabindex="0" role="button"><div class="sc-hDcvty jpmGrk"><span>https://khofmann.userpage.fu-berlin.de/phpCourse/exam/api</span>/user/{id}</div></div></div></div></div><div><h3 class="sc-kkmypM jKNCPF"> <!-- -->Response samples<!-- --> </h3><div class="sc-bSlUec jxQggo" data-rttabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="tab:R176aa:0" aria-selected="true" aria-disabled="false" aria-controls="panel:R176aa:0" tabindex="0" data-rttab="true">200</li><li class="tab-error" role="tab" id="tab:R176aa:1" aria-selected="false" aria-disabled="false" aria-controls="panel:R176aa:1" data-rttab="true">404</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="panel:R176aa:0" aria-labelledby="tab:R176aa:0"><div><div class="sc-WChnI iLXIA-d"><span class="sc-foMnoT dmNpjh">Content type</span><div class="sc-ZubPq KmnOC">application/json</div></div><div class="sc-AmOMz gDrQpr"><div class="sc-eTdEpr dgzSkD"><div class="sc-pFPEP bMXXJy"><button><div class="sc-eHujzY ecCAmX">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div class="sc-euGpHm fwfkcU sc-fTgapq bDqsIm"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"id"</span>: <span class="token number">0</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"username"</span>: <span class="token string">"string"</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"status"</span>: <span class="token number">0</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"email"</span>: <span class="token string">"string"</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"image"</span>: <span class="token string">"string"</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"isAdmin"</span>: <span class="token boolean">true</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"memberSince"</span>: <button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable collapsed"><span class="property token string">"date"</span>: <span class="token string">"2019-08-24T14:15:22Z"</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"timezone_type"</span>: <span class="token number">0</span><span class="token punctuation">,</span></div></li><li><div class="hoverable collapsed"><span class="property token string">"timezone"</span>: <span class="token string">"string"</span></div></li></ul><span class="token punctuation">}</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"postCount"</span>: <span class="token number">0</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div><div class="react-tabs__tab-panel" role="tabpanel" id="panel:R176aa:1" aria-labelledby="tab:R176aa:1"></div></div></div></div></div></div></div><div class="sc-epzHnm bWkBKa"></div></div></div>
|
||||
<script>
|
||||
const __redoc_state = {"menu":{"activeItemIdx":-1},"spec":{"data":{"openapi":"3.0.0","info":{"title":"PHP Course Exam","version":"1.0.0","contact":{"name":"Kilian Kurt Hofmann","email":"khofmann@zedat.fu-berlin.de"},"description":"PHP Course (ABV FU Berlin) 2024 Exam"},"paths":{"/login":{"post":{"summary":"Login","description":"Log in user.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResponse"}}}},"400":{"description":"Missing fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MissingFieldResponse"},"examples":{"Missing fields":{"value":{"code":"MissingField","fields":["email","password"]}}}}}},"401":{"description":"Invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedResponse"},"examples":{"Invalid username or password":{"value":{"code":"Unauthorized","message":"Invalid username or password"}}}}}},"404":{"description":"User not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"},"examples":{"User not found":{"value":{"code":"NotFound","entity":"user"}}}}}},"500":{"description":"Failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FailedResponse"},"examples":{"Failed":{"value":{"code":"Failed","message":"Login failed"}}}}}}},"tags":["Login/Logout"]}},"/logout":{"post":{"summary":"Logout","description":"Log out user.","security":[{"BasicAuth":[]}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BooleanResponse"},"examples":{"Success":{"value":true}}}}}},"tags":["Login/Logout"]}},"/posts":{"get":{"summary":"List posts","description":"List all posts, return full user data if authenticated.","security":[{},{"BasicAuth":[]}],"parameters":[{"in":"query","name":"p","schema":{"type":"integer","minimum":0,"default":0},"description":"Current page."},{"in":"query","name":"l","schema":{"type":"integer","minimum":0,"maximum":30,"default":10},"description":"The number of items to return."}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostListResponse"},"examples":{"Not authenticated":{"value":{"pages":0,"data":[{"id":0,"user":{"username":"string"},"content":"string","postedAt":{"date":"2019-08-24T14:15:22Z","timezone_type":0,"timezone":"string"}}]}},"Authenticated":{"value":{"pages":1,"data":[{"id":1,"user":{"id":0,"username":"string","status":0,"email":"string","image":"string","isAdmin":true,"memberSince":{"date":"2019-08-24T14:15:22Z","timezone_type":0,"timezone":"string"},"postCount":0},"content":"string","postedAt":{"date":"2019-08-24T14:15:22Z","timezone_type":0,"timezone":"string"}}]}}}}}}},"tags":["Post"]},"post":{"summary":"New post","description":"Create a new post.","security":[{"BasicAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostCreateRequest"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostResponse"}}}},"400":{"description":"Missing fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MissingFieldResponse"},"examples":{"Missing fields":{"value":{"code":"MissingField","fields":["content"]}}}}}}},"tags":["Post"]}},"/post/{id}":{"patch":{"summary":"Update post","description":"Update post with ID. <br> Requires logged in user to have admin permissions for posts not made by them.","security":[{"BasicAuth":[]},{"BasicAuth":["isAdmin"]}],"parameters":[{"name":"id","in":"path","description":"Post ID","required":true,"schema":{"type":"integer","format":"int14"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostUpdateRequest"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostResponse"}}}},"401":{"description":"Not allowed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedResponse"},"examples":{"Not allowed":{"value":{"code":"Unauthorized","message":"Not allowed"}}}}}},"404":{"description":"Post not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"},"examples":{"Post not found":{"value":{"code":"NotFound","entity":"post"}}}}}},"500":{"description":"Update failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FailedUpdateResponse"},"examples":{"Failed":{"value":{"code":"FailedUpdate","fields":["content"]}}}}}}},"tags":["Post"]},"delete":{"summary":"Delete post","description":"Delete post with ID.","security":[{"BasicAuth":["isAdmin"]}],"parameters":[{"name":"id","in":"path","description":"Post ID","required":true,"schema":{"type":"integer","format":"int14"Line truncated
|
||||
const __redoc_state = {"menu":{"activeItemIdx":-1},"spec":{"data":{"openapi":"3.0.0","info":{"title":"PHP Course Exam","version":"1.0.0","contact":{"name":"Kilian Kurt Hofmann","email":"khofmann@zedat.fu-berlin.de"},"description":"PHP Course (ABV FU Berlin) 2024 Exam"},"paths":{"/login":{"post":{"summary":"Login","description":"Log in user.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResponse"}}}},"400":{"description":"Missing fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MissingFieldResponse"},"examples":{"Missing fields":{"value":{"code":"MissingField","fields":["email","password"]}}}}}},"401":{"description":"Invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedResponse"},"examples":{"Invalid username or password":{"value":{"code":"Unauthorized","message":"Invalid username or password"}}}}}},"404":{"description":"User not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"},"examples":{"User not found":{"value":{"code":"NotFound","entity":"user"}}}}}},"500":{"description":"Failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FailedResponse"},"examples":{"Failed":{"value":{"code":"Failed","message":"Login failed"}}}}}}},"tags":["Login/Logout"]}},"/logout":{"post":{"summary":"Logout","description":"Log out user.","security":[{"BasicAuth":[]}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BooleanResponse"},"examples":{"Success":{"value":true}}}}}},"tags":["Login/Logout"]}},"/posts":{"get":{"summary":"List posts","description":"List all posts, return full user data if authenticated.","security":[{},{"BasicAuth":[]}],"parameters":[{"in":"query","name":"p","schema":{"type":"integer","minimum":0,"default":0},"description":"Current page."},{"in":"query","name":"l","schema":{"type":"integer","minimum":0,"maximum":30,"default":10},"description":"The number of items to return."}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostListResponse"},"examples":{"Not authenticated":{"value":{"pages":0,"data":[{"id":0,"user":{"username":"string"},"content":"string","postedAt":{"date":"2019-08-24T14:15:22Z","timezone_type":0,"timezone":"string"}}]}},"Authenticated":{"value":{"pages":1,"data":[{"id":1,"user":{"id":0,"username":"string","status":0,"email":"string","image":"string","isAdmin":true,"memberSince":{"date":"2019-08-24T14:15:22Z","timezone_type":0,"timezone":"string"},"postCount":0},"content":"string","postedAt":{"date":"2019-08-24T14:15:22Z","timezone_type":0,"timezone":"string"}}]}}}}}}},"tags":["Post"]},"post":{"summary":"New post","description":"Create a new post.","security":[{"BasicAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostCreateRequest"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostResponse"}}}},"400":{"description":"Missing fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MissingFieldResponse"},"examples":{"Missing fields":{"value":{"code":"MissingField","fields":["content"]}}}}}}},"tags":["Post"]}},"/post/{id}":{"patch":{"summary":"Update post","description":"Update post with ID. <br> Requires logged in user to have admin permissions for posts not made by them.","security":[{"BasicAuth":[]},{"BasicAuth":["isAdmin"]}],"parameters":[{"name":"id","in":"path","description":"Post ID","required":true,"schema":{"type":"integer","format":"int14"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostUpdateRequest"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostResponse"}}}},"401":{"description":"Not allowed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedResponse"},"examples":{"Not allowed":{"value":{"code":"Unauthorized","message":"Not allowed"}}}}}},"404":{"description":"Post not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"},"examples":{"Post not found":{"value":{"code":"NotFound","entity":"post"}}}}}},"500":{"description":"Update failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FailedUpdateResponse"},"examples":{"Failed":{"value":{"code":"FailedUpdate","fields":["content"]}}}}}}},"tags":["Post"]},"delete":{"summary":"Delete post","description":"Delete post with ID.","security":[{"BasicAuth":["isAdmin"]}],"parameters":[{"name":"id","in":"path","description":"Post ID","required":true,"schema":{"type":"integer","format":"int14"Line truncated
|
||||
|
||||
var container = document.getElementById('redoc');
|
||||
Redoc.hydrate(__redoc_state, container);
|
||||
|
||||
Reference in new issue
Block a user