order-preserving-section-mapping

Installation
SKILL.md

Map every section, in the order it arrived

The response is a list of shelves. The domain model must be a list of shelves too — the moment it becomes a record with named fields, the mapping has to guess which index is which, and that guess is the bug:

// adapted: names generalized
@Serializable
data class Catalog(val sections: List<CatalogSection>)

@Serializable
data class CatalogSection(
    /** Section heading exactly as the service returned it. */
    val title: String,
    val items: List<CatalogItem>,
)
Installs
2
GitHub Stars
35
First Seen
6 days ago
order-preserving-section-mapping — maxrave-dev/kotlin-footguns