Skip to content

Commit

Permalink
api - change deletion endpoint to param based
Browse files Browse the repository at this point in the history
Request body seems to not be couraged by
flask/connexion generator framework.
  • Loading branch information
cherusk committed Nov 16, 2023
1 parent 4dd87cd commit f9549e7
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 53 deletions.
100 changes: 50 additions & 50 deletions api/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,41 @@ paths:
properties:
message:
type: string
delete:
description: Purge a breeder
put:
description: Update a breeder configuration
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- name
properties:
name:
type: string
responses:
'204':
description: Successfully updated the running breeder
'400':
description: Invalid request
content:
application/json:
schema:
type: object
properties:
message:
type: string

/breeders/{name}:
delete:
description: Purge a breeder
parameters:
- name: name
in: path
required: true
schema:
type: string
responses:
'200':
description: Successfully purged the breeder
Expand All @@ -99,22 +126,28 @@ paths:
properties:
message:
type: string
put:
description: Update a breeder configuration
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- name
properties:
name:
type: string
get:
description: Obtain information about breeder from its name
parameters:
- name: name
in: path
required: true
schema:
type: string
responses:
'204':
description: Successfully updated the running breeder
'200':
description: Successfully returned list of configured breeders
content:
application/json:
schema:
type: array
items:
type: object
required:
- name
properties:
name:
type: string
'400':
description: Invalid request
content:
Expand All @@ -124,36 +157,3 @@ paths:
properties:
message:
type: string

/breeders/{name}:
get:
description: Obtain information about breeder from its name
parameters:
- name: name
in: path
required: true
schema:
type: string
responses:
'200':
description: Successfully returned list of configured breeders
content:
application/json:
schema:
type: array
items:
type: object
required:
- name
properties:
name:
type: string
'400':
description: Invalid request
content:
application/json:
schema:
type: object
properties:
message:
type: string
4 changes: 1 addition & 3 deletions cli/maskfile.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,7 @@ set -eEux
__api_version="${api_version:-v0}"

curl --request DELETE \
-H 'Content-Type: application/json' \
--data "{ \"name\": \"${name}\" }" \
"http://${hostname}:${port}/${__api_version}/breeders"
"http://${hostname}:${port}/${__api_version}/breeders/${name}"
~~~

### breeder update
Expand Down

0 comments on commit f9549e7

Please sign in to comment.