Skip to content

Conversation

@techouse
Copy link
Contributor

@techouse techouse commented Apr 30, 2025

👋 Hi there! I’m the author of qs_dart, a Dart port of qs for JavaScript.

I’ve given the buildUrlString utility method a thorough overhaul to boost its reliability and maintainability. Below is a summary of the key improvements:

🚀 Core Enhancements

  • Stricter URL Validation
  • Now raises an ArgumentError for malformed or non-HTTP(S) URLs
  • Relies on Dart’s Uri.parse and basic checks - no more ad-hoc string assumptions
  • Robust Query Encoding
  • Switched to the qs_dart library for all query-string serialization
  • Preserves existing multi-valued parameters and URL fragments

🛠️ New Dependencies

  • qs_dart (v1.3.8) – Advanced query-string encoding
  • validators (v3.0.0) – Optional URL format checks

✅ Expanded Test Coverage

Added new cases in test/utils/utils_test.dart to validate:

  • Parameter edge cases
  • null / empty maps, empty‐string values, overriding existing keys
  • URL integrity
  • Preserving fragments, rejecting invalid URLs
  • Encoding nuances
  • Special characters, reserved symbols (@, /), spaces vs. plus signs
  • Data types & collections
  • Numeric and boolean values, lists (including empty items), insertion-order guarantees

These tests ensure that buildUrlString behaves correctly across all common and edge scenarios.

@techouse
Copy link
Contributor Author

techouse commented May 1, 2025

@CodingAleCR I have added URL validation to the buildUrlString. If that's not desired, I can remove it.

@stale
Copy link

stale bot commented Jul 19, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Jul 19, 2025
# Conflicts:
#	lib/utils/query_parameters.dart
#	test/utils/utils_test.dart
@stale stale bot removed the wontfix This will not be worked on label Jul 22, 2025
@techouse techouse changed the title feat: use qs_dart in buildUrlString feat: use qs_dart in buildUrlString for enhanced query string encoding Jul 22, 2025
@CodingAleCR CodingAleCR merged commit 8bb04cf into CodingAleCR:main Jul 22, 2025
1 check passed
@CodingAleCR
Copy link
Owner

@all-contributors add @techouse for code and docs

@allcontributors
Copy link
Contributor

@CodingAleCR

I've put up a pull request to add @techouse! 🎉

@CodingAleCR
Copy link
Owner

@CodingAleCR I have added URL validation to the buildUrlString. If that's not desired, I can remove it.

Thank you for contributing to the library, I'm sorry it took so long 🙏🏻

@techouse
Copy link
Contributor Author

@CodingAleCR no worries 😊

@techouse techouse deleted the feat/qs branch July 22, 2025 13:35
@techouse techouse mentioned this pull request Jul 26, 2025
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants