Skip to content

Commit

Permalink
Merge pull request #14388 from wbt-solutions/chore/maintain-statuses-…
Browse files Browse the repository at this point in the history
…api-spec

[chore] maintained status collection api specification
  • Loading branch information
Kharonus authored Jan 4, 2024
2 parents 96a1ce6 + 67d07fc commit 58e9c4d
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 147 deletions.
72 changes: 72 additions & 0 deletions docs/api/apiv3/components/examples/status_collection.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Example: Status collection
---
value:
_embedded:
elements:
- _links:
self:
href: "/api/v3/statuses/1"
_type: Status
defaultDoneRatio: 0
id: 1
isClosed: false
isDefault: true
name: New
position: 1
- _links:
self:
href: "/api/v3/statuses/3"
_type: Status
defaultDoneRatio: 75
id: 3
isClosed: false
isDefault: false
isReadonly: false
name: Resolved
position: 3
- _links:
self:
href: "/api/v3/statuses/4"
_type: Status
defaultDoneRatio: 25
id: 4
isClosed: false
isDefault: false
name: Feedback
position: 4
- _links:
self:
href: "/api/v3/statuses/5"
_type: Status
defaultDoneRatio: 100
id: 5
isClosed: true
isDefault: false
name: Closed
position: 5
- _links:
self:
href: "/api/v3/statuses/6"
_type: Status
defaultDoneRatio: 100
id: 6
isClosed: true
isDefault: false
name: Rejected
position: 6
- _links:
self:
href: "/api/v3/statuses/2"
_type: Status
defaultDoneRatio: 50
id: 2
isClosed: false
isDefault: false
name: In Progress
position: 3
_links:
self:
href: "/api/v3/statuses"
_type: Collection
count: 6
total: 6
30 changes: 30 additions & 0 deletions docs/api/apiv3/components/schemas/status_collection_model.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Schema: StatusCollectionModel
---
allOf:
- $ref: './collection_model.yml'
- type: object
required:
- _links
- _embedded
properties:
_links:
type: object
required:
- self
properties:
self:
allOf:
- $ref: './link.yml'
- description: |-
This file links collection
**Resource**: StatusCollectionModel
_embedded:
type: object
required:
- elements
properties:
elements:
type: array
items:
$ref: './status_model.yml'
73 changes: 0 additions & 73 deletions docs/api/apiv3/components/schemas/statuses_model.yml

This file was deleted.

6 changes: 4 additions & 2 deletions docs/api/apiv3/openapi-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,8 @@ components:
$ref: './components/examples/query.yml'
QuerySchemaModel:
$ref: './components/examples/query_schema.yml'
StatusCollection:
$ref: './components/examples/status_collection.yml'
StoragesSimpleCollectionModel:
$ref: './components/examples/storages-simple-collection-response.yml'
ValuesPropertyStartDateSchema:
Expand Down Expand Up @@ -735,10 +737,10 @@ components:
"$ref": "./components/schemas/schema_for_project_queries_model.yml"
Star_QueryModel:
"$ref": "./components/schemas/star_query_model.yml"
StatusCollectionModel:
"$ref": "./components/schemas/status_collection_model.yml"
StatusModel:
"$ref": "./components/schemas/status_model.yml"
StatusesModel:
"$ref": "./components/schemas/statuses_model.yml"
StorageCollectionModel:
"$ref": "./components/schemas/storage_collection_model.yml"
StorageFileModel:
Expand Down
75 changes: 3 additions & 72 deletions docs/api/apiv3/paths/statuses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,79 +6,10 @@ get:
content:
application/hal+json:
examples:
response:
value:
_embedded:
elements:
- _links:
self:
href: "/api/v3/statuses/1"
_type: Status
defaultDoneRatio: 0
id: 1
isClosed: false
isDefault: true
name: New
position: 1
- _links:
self:
href: "/api/v3/statuses/3"
_type: Status
defaultDoneRatio: 75
id: 3
isClosed: false
isDefault: false
isReadonly: false
name: Resolved
position: 3
- _links:
self:
href: "/api/v3/statuses/4"
_type: Status
defaultDoneRatio: 25
id: 4
isClosed: false
isDefault: false
name: Feedback
position: 4
- _links:
self:
href: "/api/v3/statuses/5"
_type: Status
defaultDoneRatio: 100
id: 5
isClosed: true
isDefault: false
name: Closed
position: 5
- _links:
self:
href: "/api/v3/statuses/6"
_type: Status
defaultDoneRatio: 100
id: 6
isClosed: true
isDefault: false
name: Rejected
position: 6
- _links:
self:
href: "/api/v3/statuses/2"
_type: Status
defaultDoneRatio: 50
id: 2
isClosed: false
isDefault: false
name: In Progress
position: 3
_links:
self:
href: "/api/v3/statuses"
_type: Collection
count: 6
total: 6
'simple status collection':
$ref: "../components/examples/status_collection.yml"
schema:
"$ref": "../components/schemas/statuses_model.yml"
"$ref": "../components/schemas/status_collection_model.yml"
description: OK
headers: {}
'403':
Expand Down

0 comments on commit 58e9c4d

Please sign in to comment.