api_to_dart 0.3.1
api_to_dart: ^0.3.1 copied to clipboard
Convert any API (Postman, OpenAPI, Apidog, or YAML) into type-safe Dart actions and response models with an interactive terminal UI.
0.3.1 #
Changed #
- Running
api2dartwith no arguments now launches the interactive wizard directly instead of printing the usage screen. All other commands and flags (--help,version,upgrade, etc.) behave exactly as before.
0.3.0 #
New #
versionsubcommand — prints the installed version.upgradesubcommand — pulls the latest release from pub.dev.- Automatic update notice after any command when a newer version is available on pub.dev.
Changed #
- Request logs are now Markdown (
.md) instead of plain.log, with formatted sections for URL, headers, request body, status code, and response body. - Generated files are written under a dated subfolder
(
<output>/<YYYY-MM-DD>/actions/and.../logs/) so repeated runs don't overwrite previous outputs. The default--outputis nowapi2dart(waslib/actions).
0.2.0 #
Renamed package from api_request_generator to api_to_dart. The
executable is now api2dart and the per-project config directory is
.api2dart/ (the previous .apigen/ is no longer read or written).
New #
resetsubcommand for clearing saved settings. Defaults to wiping wizard selections only; pass--allto also remove saved Postman/Apidog tokens, or-yto skip the confirmation prompt.- Postman environments — after picking a workspace the wizard now
fetches its environments, lets you pick one (or skip), and merges
the variables on top of any collection-level variables before
resolving
base_url/token. - Response-only output mode for projects that don't depend on
api_request. Auto-detected from the hostpubspec.yaml; override with-m, --mode={auto,action,response-only}. In response-only mode files are written as*_response.dart(noapi_requestimport) and endpoints with no response data are skipped.
Fixed #
- Postman collections list parsing: the API returns the array under
the
collectionskey (plural). The previous code readcollection(singular) and always saw an empty list. - Stop auto-clearing saved API tokens after a failed request. Network
glitches or rate limits used to wipe a valid key; now the user is
pointed at
api2dart reset --allinstead.
Changed #
- The
--resetflag ongeneratewas replaced by the standaloneresetsubcommand. - Wizard banner, help text, and saved-settings paths updated for the new name.
0.1.0 #
- Initial release
- Multi-source support: Postman collections, OpenAPI 3.x specs, Apidog projects, local YAML files
- Apidog integration: fetch projects, environments, and variables via API
- Interactive terminal endpoint selector with tree navigation
- Smart response resolution: live fetch → example → schema → action-only
- Request logging with detailed .log files per endpoint
- Dart model generation with fromJson/toJson from actual API responses
- Auto-resolve environment variables from Apidog
- Settings persistence per-project in .apigen/config.yaml
- Support for all HTTP methods: GET, POST, PUT, PATCH, DELETE
- PascalCase naming with smart path-based name generation
- Handles duplicate class names and null types in generated models