Attempts to improve the "attachments" models.

There's lots of redundancy in the API spec which leads to generation of
duplicate but distinct / incompatible model classes during code
generation.

The "attachment" object type is only on of several places where this
occurs in the spec, but I'd get feedback if this unification is desired
first before investing more time in cleaning up definitions.
pull/10178/head
Gunter Ohrner 3 years ago
parent 192367d6e3
commit 741ad6bf14
  1. 15
      docs/api/apiv3/components/schemas/attachments_model.yml
  2. 14
      docs/api/apiv3/openapi-spec.yml
  3. 2
      docs/api/apiv3/paths/post_attachments.yml
  4. 2
      docs/api/apiv3/paths/wiki_page_attachments.yml
  5. 2
      docs/api/apiv3/paths/work_package_attachments.yml

@ -0,0 +1,15 @@
# Schema: Attachments
---
type: object
properties:
_embedded:
type: object
properties:
elements:
type: array
readOnly: true
items:
allOf:
- "$ref": "./attachment_model.yml"
- description: Collection of Attachments
readOnly: true

@ -435,18 +435,8 @@ components:
"$ref": "./components/schemas/activity_model.yml"
AttachmentModel:
"$ref": "./components/schemas/attachment_model.yml"
Attachments_by_post:
"$ref": "./components/schemas/attachments_by_post.yml"
Attachments_by_postModel:
"$ref": "./components/schemas/attachments_by_post_model.yml"
Attachments_by_wiki_page:
"$ref": "./components/schemas/attachments_by_wiki_page.yml"
Attachments_by_wiki_pageModel:
"$ref": "./components/schemas/attachments_by_wiki_page_model.yml"
Attachments_by_work_package:
"$ref": "./components/schemas/attachments_by_work_package.yml"
Attachments_by_work_packageModel:
"$ref": "./components/schemas/attachments_by_work_package_model.yml"
Attachments_Model:
"$ref": "./components/schemas/attachments_model.yml"
Available_AssigneesModel:
"$ref": "./components/schemas/available_assignees_model.yml"
Available_ResponsiblesModel:

@ -53,7 +53,7 @@ get:
count: 1
total: 1
schema:
"$ref": "../components/schemas/attachments_by_post_model.yml"
"$ref": "../components/schemas/attachments_model.yml"
description: OK
headers: {}
'404':

@ -53,7 +53,7 @@ get:
count: 1
total: 1
schema:
"$ref": "../components/schemas/attachments_by_wiki_page_model.yml"
"$ref": "../components/schemas/attachments_model.yml"
description: OK
headers: {}
'404':

@ -14,7 +14,7 @@ get:
content:
application/hal+json:
schema:
"$ref": "../components/schemas/attachments_by_work_package_model.yml"
"$ref": "../components/schemas/attachments_model.yml"
description: OK
headers: {}
'404':

Loading…
Cancel
Save