torrust / torrust-index

This repository serves as the backend for the Torrust Index project.
https://torrust.com
GNU Affero General Public License v3.0
50 stars 19 forks source link

Decouple API resources from internal structures #164

Open josecelano opened 1 year ago

josecelano commented 1 year ago

The API endpoints return internal objects, for example:

The endpoint to get all categories:

http://127.0.0.1:3000/v1/category

returns the struct Category:

pub struct Category {
    pub category_id: i64,
    pub name: String,
    pub num_torrents: i64,
}

That's only one example.

That has some problems:

We could change it progressively or when we implement the API v2.

Subtasks

cgbosse commented 9 months ago

@da2ce7 and @WarmBeer any comments?