Skip to content

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

@sean-r-williams

Description

@sean-r-williams

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions