Skip to content

Question: Generated C# client does not work because of gRPC encoded parameter #30

Open
@sommmen

Description

@sommmen

Hiya,

I'm trying to list reviews via the google my business api.

I'm following this doc:
https://developers.google.com/my-business/content/review-data#list_all_reviews

Which is this api:
https://developers.google.com/my-business/reference/rest/v4/accounts.locations.reviews/list

This describes the following endpoint:
GET https://mybusiness.googleapis.com/v4/accounts/{accountId}/locations/{locationId}/reviews
`

Which gets translated to the following swagger definition:

  "/v4/{parent}/reviews":
    get:
      description: Returns the paginated list of reviews for the specified location. This operation is only valid if the specified location is verified.
      operationId: mybusiness.accounts.locations.reviews.list
      parameters:
        - description: The name of the location to fetch reviews for.
          in: path
          name: parent
          required: true
          schema:
            type: string

I'm using this document to genera a c# client with NSwag, but this has the issue that the parameter path gets url encoded (meaning the slashes are escaped), creating a malformed url.

My C# client now pushed out a request like so:

https://mybusiness.googleapis.com/v4/accounts%2F123456789123456789123%2Flocations%2F1234567891234567891/reviews?pageSize=50

While it should be:

https://mybusiness.googleapis.com/v4/accounts/123456789123456789123/locations/1234567891234567891/reviews?pageSize=50

Now this is not an issue with this generator, but it does make the swagger doc unusable. Does anyone know a way to specificy that the parameter should not be url encoded so that generated clients can create a proper request?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions