wikimedia_dart 0.1.2
wikimedia_dart: ^0.1.2 copied to clipboard
A type-safe Dart client for the Wikimedia REST APIs, covering Wikipedia, Wiktionary, Commons, and other Wikimedia projects.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.1.2 - 2026-10-21 #
Fixed #
search.pages(),search.autocomplete()andpages.related()returned garbled text for anything outside ASCII when the app resolved http older than 1.4.0, which the^1.2.0constraint allows. Those endpoints send JSON without a charset, and older http decoded it as latin1. JSON responses are now always decoded as UTF-8.close()didn't stop a call already in progress: it kept retrying, so requests were still sent afterclose(). It now stops and rethrows the last failure.- One search hit whose thumbnail had no width or height made the whole
search.pages()orrelated()call throwWikiParseException. Missing dimensions now read as 0. - Titles with spaces were sent as
%20. The HTML endpoint answers that with a redirect, which cost a second request. Titles now go out with underscores, the form MediaWiki uses itself. toString()on exceptions printed minified type names in release web builds. The names are now spelled out.- A fractional timeout was reported in whole seconds, so 1500ms read as "1s".
- The default
User-Agentreported a hardcodedWikimediaDart/0.1.0from every constructor, so 0.1.1 identified itself to Wikimedia as 0.1.0. It is now derived from a single version constant, and a test asserts that constant matchespubspec.yamlso a release bump can't leave it behind again. SearchResponsecompared itspageslist by identity, so two responses holding equal results were never equal. They now compare element by element, with a matchinghashCode.- The SDK constraint said Dart 3.0, but
http ^1.2.0already needed 3.2. It now says 3.2.
Added #
toJson()on every model, round-tripping through the matchingfromJson(). Absent optional fields are omitted rather than written asnull.
Changed #
- Exception messages include the server's reason when an error response carries one, for example why a 400 was rejected.
- The README and API docs now say what actually works:
custom()only supports search in 0.1.x, the language override is the wiki's subdomain code,getFile()needs a Commons client for Commons files, and Wikidata has no summary or media-list endpoint.
0.1.1 - 2026-09-03 #
Analysis-only release. No API or behavior changes.
Fixed #
- The
unawaited_return_in_try_blockwarning inServiceBase._getOnce, which cost the package 20 pub points on the published 0.1.0.dart analyzeis clean again.
0.1.0 - 2026-07-23 #
First stable release. Drops the beta tag and adds automatic retries, clearer
error mapping, and a working related().
Added #
- Automatic retry with exponential backoff for transient failures (429, 5xx,
network, and timeout), configurable through the new
RetryPolicy. On by default with 3 retries; disable withRetryPolicy.none(). A serverRetry-Afteron a 429 or 503 is honored, capped atmaxBackoff. WikiRequestExceptionfor 4xx responses other than 404 and 429 (400, 401, 403, ...). These used to surface asWikiServerException.WikiServerException.retryAfter, read from theRetry-Afterheader on a 5xx.- A live integration suite (
test/integration/) that runs against the real Wikimedia API. Skipped by default; run it withdart test --run-skipped --tags integration. A nightly CI job runs it to catch upstream changes.
Changed #
- Breaking:
PagesClient.related()now returnsList<SearchResultItem>instead ofList<PageSummary>and takes an optionallimit. The REST/page/related/endpoint started returning 403, sorelated()is now built on the search endpoint'smorelike:operator, which restores the feature.
Fixed #
- 4xx responses other than 404/429 were reported as
WikiServerExceptionwith an "Unexpected status code" message; they now map toWikiRequestException.
0.1.0-beta.1 - 2026-06-29 #
First public release for testing and feedback.
Added #
- Project scaffold: directory structure,
pubspec.yaml,analysis_options.yaml. WikiProjectenum covering the supported Wikimedia projects.WikiConfigimmutable settings object.EndpointsREST path constants.UrlBuilderfor all URI construction.- Sealed
WikiExceptionhierarchy:WikiNetworkException,WikiTimeoutException,WikiNotFoundException,WikiRateLimitException,WikiServerException,WikiParseException. PageSummary,WikiThumbnail,ContentUrlsmodels.SearchResponse,SearchResultItemmodels.MediaItem,MediaFilemodels.ServiceBasemixin with the shared request lifecycle.PagesClient(summary,html,related),SearchClient(pages,autocomplete),MediaClient(listForPage,getFile).WikiCliententry point with named constructors and HTTP lifecycle handling.- GitHub Actions CI,
UrlBuildertests, and model parsing tests.