Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor V2ServerAPICalls/NuGetServerAPICalls to use object-oriented query builder (instead of string manipulation) #1643

Closed
sean-r-williams opened this issue Apr 23, 2024 · 0 comments · Fixed by #1645

Comments

@sean-r-williams
Copy link
Contributor

Summary of the new feature / enhancement

Currently, V2ServerAPICalls and NuGetServerAPICalls build NuGet v2 API call URLs through direct manipulation of the query URL. This has several limitations:

Moving to an object-oriented approach would make these problems easier to avoid altogether.

Proposed technical implementation details (optional)

Refactor V2ServerAPICalls/NuGetServerAPICalls to:

  • Utilize some type of container (List<String>, HashSet<String>, or similar) to hold query clauses, then build a formatted query with combining operators in the appropriate places
  • Handle URL encoding through either:
    • Off-label use of HttpValueCollection to dynamically build a query string (with built-in URL-safe encoding)
    • Direct serialization of key-value pairs with Uri.EscapeDataString
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
1.0.5
Done
2 participants