Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#40642] fixed API spec merging issue with collection links #16477

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs/api/apiv3/components/schemas/collection_links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Schema: CollectionLinks
---
type: object
required:
- self
properties:
self:
allOf:
- $ref: './link.yml'
- description: |-
This collection resource.

**Resource**: Collection
12 changes: 1 addition & 11 deletions docs/api/apiv3/components/schemas/collection_model.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,4 @@ properties:
description: Actual amount of elements in this response.
minimum: 0
_links:
type: object
required:
- self
properties:
self:
allOf:
- $ref: './link.yml'
- description: |-
This collection resource.

**Resource**: Collection
$ref: './collection_links.yml'
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Schema: OffsetPaginatedCollectionLinks
---
allOf:
- $ref: './collection_links.yml'
- type: object
required:
- jumpTo
- changeSize
properties:
jumpTo:
allOf:
- $ref: './link.yml'
- description: A templated link to jump to a given offset.
changeSize:
allOf:
- $ref: './link.yml'
- description: A templated link to change the current page size.
previousByOffset:
allOf:
- $ref: './link.yml'
- description: |-
A link to the previous page of the collection.

# Conditions
- The collection is not on the first page.
nextByOffset:
allOf:
- $ref: './link.yml'
- description: |-
A link to the next page of the collection.

# Conditions
- The collection is not on the last page.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Schema: OffsetPaginatedCollectionModel
---
allOf:
- $ref: './collection_model.yml'
- type: object
required:
- pageSize
- offset
- _links
properties:
pageSize:
type: integer
description: |-
The amount of elements per page. If not set by the request this value defaults to the server's system
settings.
minimum: 0
offset:
type: integer
description: The page offset indicating on which page the element collection starts.
minimum: 0
_links:
$ref: './offset_paginated_collection_links.yml'
16 changes: 1 addition & 15 deletions docs/api/apiv3/components/schemas/principal_collection_model.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,11 @@
# Schema: PrincipalCollectionModel
---
allOf:
- $ref: './collection_model.yml'
- $ref: './offset_paginated_collection_model.yml'
- type: object
required:
- _links
- _embedded
properties:
_links:
type: object
required:
- self
- representations
properties:
self:
allOf:
- $ref: "./link.yml"
- description: |-
This principal collection

**Resource**: Collection
_embedded:
type: object
required:
Expand Down
32 changes: 12 additions & 20 deletions docs/api/apiv3/components/schemas/project_collection_model.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,24 @@
# Schema: ProjectCollectionModel
---
allOf:
- $ref: './collection_model.yml'
- $ref: './offset_paginated_collection_model.yml'
- type: object
required:
- _links
- _embedded
properties:
_links:
type: object
required:
- self
- representations
properties:
self:
allOf:
- $ref: './link.yml'
- description: |-
This project collection

**Resource**: ProjectStorageCollectionModel
representations:
type: array
items:
allOf:
- $ref: './link.yml'
- description: |-
A project collection representation in a specific file format.
allOf:
- $ref: './offset_paginated_collection_links.yml'
- type: object
properties:
representations:
type: array
items:
allOf:
- $ref: './link.yml'
- description: |-
A project collection representation in a specific file format.
_embedded:
type: object
required:
Expand Down
6 changes: 6 additions & 0 deletions docs/api/apiv3/openapi-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,8 @@ components:
"$ref": "./components/schemas/categories_by_project_model.yml"
CategoryModel:
"$ref": "./components/schemas/category_model.yml"
CollectionLinks:
"$ref": "./components/schemas/collection_links.yml"
CollectionModel:
"$ref": "./components/schemas/collection_model.yml"
ConfigurationModel:
Expand Down Expand Up @@ -707,6 +709,10 @@ components:
"$ref": "./components/schemas/oauth_client_credentials_read_model.yml"
OAuthClientCredentialsWriteModel:
"$ref": "./components/schemas/oauth_client_credentials_write_model.yml"
OffsetPaginatedCollectionLinks:
"$ref": "./components/schemas/offset_paginated_collection_links.yml"
OffsetPaginatedCollectionModel:
"$ref": "./components/schemas/offset_paginated_collection_model.yml"
PaginatedCollectionModel:
"$ref": "./components/schemas/paginated_collection_model.yml"
PlaceholderUserCollectionModel:
Expand Down