Browse Source

Merge pull request #5826 from Atry/rest-api-custom-field-return-type

fix: correct return type in API documentation for custom fields
Lauri Ojansivu 1 week ago
parent
commit
84259c5116
2 changed files with 9 additions and 3 deletions
  1. 1 1
      models/cards.js
  2. 8 2
      public/api/wekan.yml

+ 1 - 1
models/cards.js

@@ -4042,7 +4042,7 @@ JsonRoutes.add('GET', '/api/boards/:boardId/cards_count', function(
   * @param {string} cardId the ID of the card
   * @param {string} cardId the ID of the card
   * @param {string} customFieldId the ID of the custom field
   * @param {string} customFieldId the ID of the custom field
   * @param {string} value the new custom field value
   * @param {string} value the new custom field value
-  * @return_type {_id: string, customFields: object}
+  * @return_type {_id: string, customFields: [{_id: string, value: object}]}
   */
   */
   JsonRoutes.add(
   JsonRoutes.add(
     'POST',
     'POST',

+ 8 - 2
public/api/wekan.yml

@@ -1666,7 +1666,6 @@ paths:
          adds the label to the board.
          adds the label to the board.
       tags:
       tags:
         - Boards
         - Boards
-        - Boards
       consumes:
       consumes:
         - multipart/form-data
         - multipart/form-data
         - application/json
         - application/json
@@ -2261,7 +2260,14 @@ paths:
               _id:
               _id:
                 type: string
                 type: string
               customFields:
               customFields:
-                type: object
+                type: array
+                items:
+                  type: object
+                  properties:
+                    _id:
+                      type: string
+                    value:
+                      type: object
   /api/boards/{board}/lists/{list}/cards_count:
   /api/boards/{board}/lists/{list}/cards_count:
     get:
     get:
       operationId: get_list_cards_count
       operationId: get_list_cards_count