[Resolved] (Question) Why is the 'description' manga attribute singular and not plural?

Staff
Super Moderator
Joined
Aug 19, 2020
Messages
786
https://api.mangadex.org/docs/redoc.html#tag/Manga/operation/get-manga-id
Why is it 'title' (singular) for an object of one string and 'altTitles' (plural) for an array of objects but it's 'description' (singular) for an object of multiple strings?
:zoomeeyyyees:

image.png
 
Member
Joined
Feb 18, 2023
Messages
6
:pepehmm: yeah think you misunderstood me

It's missing the 's'
A single MDLocaleString with locale identifier and description text. As I said, until we get multiple languages it is kind of a quirky design choice but makes sense.
Then it will make sense to make it "descriptions" and it will become an array of MDLocaleStrings. It isn't an array right now so no 's' suffix.
 

rdn

Forum Admin
Staff
Developer
Joined
Jan 18, 2018
Messages
280
At some point, the design idea was that there is one [primary] title, which is a LocalizedString and will be displayed on the UI first and foremost.
Additionally, there can be any number of alternative titles (array of LocalizedString) that give additional, lower-priority titles to the manga.

A LocalizedString is a map of {locale: title}, where any number of unique(!) locale and title rows can be contained.

a primary title can be
Code:
{en: "5Toubun no Hanayome"}
with altTitles being
Code:
[
    {en: "The Five Wedded Brides"},
    {en: "The Five-Part Bride"},
    {en: "The Quintessential Quintuplets"}
]

BUT, as you can see from the request for that manga itself, languages that dont exist in the primary title tend to be put into alt titles, where by the original design idea the first (primary) title for each language should always be put into the title field first and altTitles second. It never really worked out like that, mostly because we already had a giant backlog of v3 imported titles that couldn't be converted and there was no easy way to force people to use it this way without dumb side effects.

Might be changed in the future
 
Staff
Super Moderator
Joined
Aug 19, 2020
Messages
786
A single MDLocaleString with locale identifier and description text. As I said, until we get multiple languages it is kind of a quirky design choice but makes sense.
the description manga attribute is an object of objects (multiple items), so different description locales are possible.
Then it will make sense to make it "descriptions" and it will become an array of MDLocaleStrings. It isn't an array right now so no 's' suffix.
But the links manga attribute, an object of keys with a string (multiple items) is plural too? Quite the inconsistency.
the original design idea the first (primary) title for each language should always be put into the title field first and altTitles second.
Interesting. Tho it's also quite the inconsistency with other attributes. I guess it's a very early design choice?
we already had a giant backlog of v3 imported titles that couldn't be converted
Do you mean that all imported titles were set to en? or that all v3 titles were added as alt title?

@rdn though my original question is why the description attribute is singular (description) and not plural (descriptions)
It's quite the inconsistency since other attributes with multiple items are plural.
The only explanation I can think of is that it's either a naming inconsistency or because it's an object of objects.
 

rdn

Forum Admin
Staff
Developer
Joined
Jan 18, 2018
Messages
280
the description manga attribute is an object of objects (multiple items), so different description locales are possible.
description for any entity is a flat object of string-keys (locale) to string-value (Translated description string). its not an object of objects.
Tho it's also quite the inconsistency with other attributes. I guess it's a very early design choice?
It might be inconsistent, but its not without reason. By virtue of ours being a json api, we have to work with some weird implementations where the order within a json array is not respected, although the specification demands it.
Because primary titles are very important for our usage, we chose to make it a separate attribute, with all the drawbacks you already discovered.
 

Users who are viewing this thread

Top