Patch #21378

Include Documents in Projects API

Added by Helder Manuel Torres Vieira about 6 years ago. Updated almost 6 years ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:REST API
Target version:-

Description

This patch adds documents to the Projects#show API.

They will be shown only if the include=documents parameter is passed on URL

The behaviour is exactly the same as for issue categories, trackers and modules.

Patch and Tests are included.

JSON Example

GET /projects.json?include=documents

{
  project: {
    id: 1,
    name: "Test Project",
    identifier: "test-project",
    description: "",
    homepage: "",
    status: 1,
    documents: [
      {
        id: 1,
        title: "Document 1",
        description: "Description 1",
        category: {
          id: 1,
          name: "Uncategorized" 
        },
        url: "https://redmine/documents/1",
        created_on: "2015-11-29T12:19:16Z" 
      }
    ],
    created_on: "2015-11-29T12:11:34Z",
    updated_on: "2015-11-29T12:11:34Z" 
  }
}

include_documents_in_projects_api.patch Magnifier (3.56 KB) Helder Manuel Torres Vieira, 2015-11-29 19:06

include_documents_in_projects_api_v1.patch Magnifier (3.6 KB) Helder Manuel Torres Vieira, 2015-11-29 21:31

History

#1 Updated by Helder Manuel Torres Vieira about 6 years ago

Added updated_on record and re-tested on Last Trunk (14901)

#3 Updated by Toshi MARUYAMA about 6 years ago

  • Target version set to 3.3.0

#4 Updated by Jean-Philippe Lang almost 6 years ago

  • Target version deleted (3.3.0)

I'd like to improve the documents feature in a near future (directories...). The documents API should be added after that.

Also available in: Atom PDF