Forgejo's QuotaInfo model and the seven definitions nested inside it.
'''Derived from spec/swagger.v1.json, not from a captured response''' — see com.worxbend.codeberg4s.organizations.QuotaInfo for why no quota fixture exists anywhere in this repository.
==One DTO, not eight==
QuotaInfo, QuotaGroup, QuotaRuleInfo, QuotaUsed, QuotaUsedSize, QuotaUsedSizeRepos, QuotaUsedSizeAssets, QuotaUsedSizeAssetsAttachments, QuotaUsedSizeAssetsPackages and QuotaUsedSizeGit are ten spec definitions describing one payload, and six of them exist only to hold two numbers each. Rule 6 of com.worxbend.codeberg4s.codec.WireConventions says a nested model nests its DTO — the point of which is that an embedded model's '''failure path''' is reported once, by that model. None of the size objects can fail: every leaf is a number that is either there or not, and there is no required field anywhere below used. Six DTOs, six companions and six readers would therefore buy nothing but six more places for a wire spelling to be mistyped.
So the size tree is read directly out of com.worxbend.codeberg4s.codec.JsonFields here, and the '''two''' definitions that carry a list of things worth naming — QuotaGroup and QuotaRuleInfo — do get DTOs of their own, because a caller reads them and because a future required field would land there.
==Wire spellings worth pointing at==
git.LFSis upper-case, alone in this payload. Go's field isLFSand the spec's generator left it alone; a reader that lower-cased it would silently report no LFS usage at all.assets.packages.allis an object with one property, not a number. Reading it as a number would answerNonefor every instance.assets.attachments.issuescovers issue '''and''' comment attachments, which the spec's own description says.
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any