fix(sravni): update entities to match current sravni.ru API #6

Merged
hermes merged 1 commits from fix/sravni-api-entity-changes into master 2026-07-01 08:05:37 +00:00
Collaborator

sravni.ru changed their __NEXT_DATA__ payload, breaking JSON deserialization in the sravni client.

Changes in entities.go:

  • ReduxConfig.DataSources: map[string]ReduxDataSourcemap[string]string (API now sends simple string values, not objects with type/source)
  • ReduxConfig.Dictionaries: removed entirely (no longer present in the API response)
  • ReduxConfigSorting: added Name and Direction fields (API now returns name, property, direction)
  • Removed dead types: DataSourceType, ReduxDataSource, ReduxConfigDictionaryRangeUnit, ReduxConfigDictionaryBaseUnit

Verified:

  • sravnicli main state — parses page state, loads dictionaries ✓
  • sravnicli api education list_products — returns courses from live API ✓
sravni.ru changed their `__NEXT_DATA__` payload, breaking JSON deserialization in the sravni client. **Changes in `entities.go`:** - `ReduxConfig.DataSources`: `map[string]ReduxDataSource` → `map[string]string` (API now sends simple string values, not objects with type/source) - `ReduxConfig.Dictionaries`: removed entirely (no longer present in the API response) - `ReduxConfigSorting`: added `Name` and `Direction` fields (API now returns `name`, `property`, `direction`) - Removed dead types: `DataSourceType`, `ReduxDataSource`, `ReduxConfigDictionaryRangeUnit`, `ReduxConfigDictionaryBaseUnit` **Verified:** - `sravnicli main state` — parses page state, loads dictionaries ✓ - `sravnicli api education list_products` — returns courses from live API ✓
hermes added 1 commit 2026-06-28 17:09:39 +00:00
dataSources changed from map[string]ReduxDataSource (objects) to
map[string]string (simple key-value pairs). Dictionaries block removed
from ReduxConfig entirely. ReduxConfigSorting now includes Name and
Direction fields alongside Property.
frx approved these changes 2026-07-01 07:40:48 +00:00
hermes merged commit 228b30ccf4 into master 2026-07-01 08:05:37 +00:00
Author
Collaborator

PR #6 Merged — Resolution Summary

fix(sravni): update entities to match current sravni.ru API

Root Cause

sravni.ru changed their __NEXT_DATA__ payload structure, breaking JSON deserialization in the sravni client. The ReduxConfig struct expected object-typed data sources and a Dictionaries block that no longer exist in the API response.

Key Changes

  • ReduxConfig.DataSources: changed from map[string]ReduxDataSource (objects with type/source fields) to map[string]string (simple key-value pairs) — matches the new API shape
  • ReduxConfig.Dictionaries: removed entirely — the block is no longer present in the API response
  • ReduxConfigSorting: added Name and Direction fields to match the API now returning name, property, and direction
  • Removed dead types: DataSourceType, ReduxDataSource, ReduxConfigDictionaryRangeUnit (no longer referenced)

Verification

  • sravnicli main state — parses page state, loads dictionaries ✓
  • sravnicli api education list_products — returns courses from live API ✓

  • PR: #6 (merged by @hermes at 2026-07-01T08:05:37Z)
  • Merge commit: 228b30cc
  • Changes: 1 file (+6/-26)
## PR #6 Merged — Resolution Summary **fix(sravni): update entities to match current sravni.ru API** ### Root Cause sravni.ru changed their `__NEXT_DATA__` payload structure, breaking JSON deserialization in the sravni client. The `ReduxConfig` struct expected object-typed data sources and a `Dictionaries` block that no longer exist in the API response. ### Key Changes - **`ReduxConfig.DataSources`**: changed from `map[string]ReduxDataSource` (objects with type/source fields) to `map[string]string` (simple key-value pairs) — matches the new API shape - **`ReduxConfig.Dictionaries`**: removed entirely — the block is no longer present in the API response - **`ReduxConfigSorting`**: added `Name` and `Direction` fields to match the API now returning `name`, `property`, and `direction` - Removed dead types: `DataSourceType`, `ReduxDataSource`, `ReduxConfigDictionaryRangeUnit` (no longer referenced) ### Verification - `sravnicli main state` — parses page state, loads dictionaries ✓ - `sravnicli api education list_products` — returns courses from live API ✓ --- - PR: #6 (merged by @hermes at 2026-07-01T08:05:37Z) - Merge commit: `228b30cc` - Changes: 1 file (+6/-26)
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: frx/kurious#6
No description provided.