This commit is contained in:
Sebastian H. Gabrielli 2023-12-25 17:59:19 +01:00
parent 7947b5234b
commit 13f0c6df6c
7 changed files with 75 additions and 43 deletions

View File

@ -1,7 +1,7 @@
_id: spc_df2177e61a724e24bc4fc1796d631d51
type: ApiSpec
parentId: wrk_0627d19078e64bb7877a6c1703c0fab8
modified: 1703326273885
modified: 1703520317303
created: 1703261567280
fileName: member-spec-sample.yaml
contents: "openapi: 3.0.0
@ -31,20 +31,16 @@ contents: "openapi: 3.0.0
\ description: \"OmegaV API server\"
\ - url: \"http://127.0.0.1:8000\"
\ description: \"Local test\"
tags:
\ - name: member
\ description: \"Operations about a member\"
\ - name: money
\ description: \"Operations about money\"
\ - name: RFID
\ description: \"Operations about a member's RFID card\"
paths:
@ -101,7 +97,7 @@ contents: "openapi: 3.0.0
\ schema:
\ $ref: \"#/components/schemas/minimalMember\"
\ $ref: \"#/components/schemas/minimalMemberWithoutId\"
\ required: true
@ -164,7 +160,7 @@ contents: "openapi: 3.0.0
\ schema:
\ $ref: '#/components/schemas/members'
\ $ref: '#/components/schemas/member'
\ '404':
@ -190,7 +186,7 @@ contents: "openapi: 3.0.0
\ in: path
\ description: \"ID of the user's who's balance will be fetched\"
\ description: \"ID of the user's who's info that will be updated\"
\ required: true
@ -208,7 +204,7 @@ contents: "openapi: 3.0.0
\ schema:
\ $ref: '#/components/schemas/minimalMember'
\ $ref: '#/components/schemas/minimalMemberWithoutId'
\ responses:
@ -222,7 +218,7 @@ contents: "openapi: 3.0.0
\ schema:
\ $ref: '#/components/schemas/members'
\ $ref: '#/components/schemas/member'
\ '404':
@ -242,8 +238,6 @@ contents: "openapi: 3.0.0
\ - member
\ - money
\ summary: \"Get a member's balance\"
\ description: \"Get a member's balance\"
@ -294,8 +288,6 @@ contents: "openapi: 3.0.0
\ - member
\ - money
\ summary: \"Change a member's balance\"
\ description: \"Add to a member's balance\"
@ -482,8 +474,6 @@ contents: "openapi: 3.0.0
\ - member
\ - RFID
\ summary: \"Get a member's RFID cards\"
\ description: \"Get all of a member's RFID cards\"
@ -534,8 +524,6 @@ contents: "openapi: 3.0.0
\ - member
\ - RFID
\ summary: \"Add RFID card\"
\ description: \"Add an RFID card to a member\"
@ -617,13 +605,57 @@ contents: "openapi: 3.0.0
\ $ref: '#/components/schemas/member'
\\
\ minimalMemberWithoutId:
\ type: object
\ description: \"The minimal values needed to create a member\"
\ properties:
\ ntnuUsername:
\ type: string
\ description: \"The NTNU username of the member\"
\ example: \"sebasthg\"
\ firstName:
\ type: string
\ description: \"First name of the member\"
\ example: \"Sebastian\"
\ lastName:
\ type: string
\ description: \"Last name of the member\"
\ example: \"Gabrielli\"
\ email:
\ type: string
\ description: \"The member's non-ntnu e-mail\"
\ example: \"sebastian@fastmail.mx\"
\ \
\ \
\ minimalMember:
\ type: object
\ description: \"The minimal values needed to create a member\"
\ description: \"The minimal values returned when createing a member\"
\ properties:
@ -637,7 +669,7 @@ contents: "openapi: 3.0.0
\ example: 1337
\ ntnuBrukernavn:
\ ntnuUsername:
\ type: string
@ -690,7 +722,7 @@ contents: "openapi: 3.0.0
\ example: 1337
\ ntnuBrukernavn:
\ ntnuUsername:
\ type: string
@ -788,7 +820,7 @@ contents: "openapi: 3.0.0
\ example: \"0364249683\"
\ cardDomment:
\ cardComment:
\ type: string

View File

@ -1,9 +1,9 @@
_id: req_0dbc0849841c4537a7ba56051747ad9b
type: Request
parentId: fld_1f771e8034294c2a9c6396fd6787b6af
modified: 1703325211504
modified: 1703519866807
created: 1703325202646
url: "{{ _.base_url }}/members/{{ _.memberId }}/balance"
url: 127.0.0.1:8000/member/1/balance
name: Change a member's balance
description: ""
method: PUT
@ -11,7 +11,7 @@ body:
mimeType: application/json
text: |-
{
"balance": 1337
"balance": -50
}
parameters: []
headers:

View File

@ -1,9 +1,9 @@
_id: req_38c60dbc1949493fa350f316027aa30e
type: Request
parentId: fld_1f771e8034294c2a9c6396fd6787b6af
modified: 1703325202644
modified: 1703519813169
created: 1703325202644
url: "{{ _.base_url }}/members/{{ _.memberId }}/balance"
url: 127.0.0.1:8000/member/1/balance
name: Get a member's balance
description: ""
method: GET

View File

@ -1,9 +1,9 @@
_id: req_6d5655cd78fd4d05a2c06b5bc443c3fa
type: Request
parentId: fld_1f771e8034294c2a9c6396fd6787b6af
modified: 1703325202640
modified: 1703505568127
created: 1703325202640
url: "{{ _.base_url }}/members"
url: 127.0.0.1:8000/members
name: Get a list of all members
description: ""
method: GET

View File

@ -1,9 +1,9 @@
_id: req_87b162ac1d564368a8933372f62f6437
type: Request
parentId: fld_1f771e8034294c2a9c6396fd6787b6af
modified: 1703325202641
modified: 1703508166488
created: 1703325202641
url: "{{ _.base_url }}/members"
url: 127.0.0.1:8000/member
name: Add a new member
description: ""
method: POST
@ -11,8 +11,7 @@ body:
mimeType: application/json
text: |-
{
"id": 1337,
"ntnuBrukernavn": "sebasthg",
"ntnuUsername": "definitely-not-sebasthg",
"firstName": "Sebastian",
"lastName": "Gabrielli",
"email": "sebastian@fastmail.mx"
@ -22,6 +21,7 @@ headers:
- name: Content-Type
disabled: false
value: application/json
id: pair_97cb010b74c0417da634ed9d7ef8dd77
authentication: {}
metaSortKey: -1703325202641
isPrivate: false

View File

@ -1,9 +1,9 @@
_id: req_98985848bfd3459c9961a645b9048841
type: Request
parentId: fld_1f771e8034294c2a9c6396fd6787b6af
modified: 1703325202643
modified: 1703518570913
created: 1703325202643
url: "{{ _.base_url }}/members/{{ _.memberId }}"
url: 127.0.0.1:8000/member/1
name: Get a member
description: ""
method: GET

View File

@ -1,9 +1,9 @@
_id: req_c599698644fa45dd8f6a72424695130c
type: Request
parentId: fld_1f771e8034294c2a9c6396fd6787b6af
modified: 1703325202644
modified: 1703518818144
created: 1703325202644
url: "{{ _.base_url }}/members/{{ _.memberId }}"
url: 127.0.0.1:8000/member/1
name: Update a member's details
description: ""
method: PUT
@ -11,8 +11,8 @@ body:
mimeType: application/json
text: |-
{
"id": 1337,
"ntnuBrukernavn": "sebasthg",
"id": 1,
"ntnuUsername": "sebasthg2",
"firstName": "Sebastian",
"lastName": "Gabrielli",
"email": "sebastian@fastmail.mx"