Skip to content

Add support for URI parameters in generated Swift code #20

@epankratov

Description

@epankratov

Some of API specs could have parameters, encoded in the URI. And Helium is not able to produce correct output in the Swift which allows to use such parameters. For instance, for the request:

  get "/service_config" spec {
    name "Available services"
    description "Returns available services for a specified affiliate."
    parameters {
      where 'string'
      max_results 'int32'
    }
    response "AffiliateServiceListResponse"
    httpHeaders header('Cache-Control', 'no-cache')
  }

it produces output like this:

    public func getServiceGroup(where: String, maxResults: Int) -> SignalProducer<AffiliateServiceGroupListResponse, APIResponseError<NSError>> {
        let url = URL(string:baseURL.absoluteString + "/service_group")!

In this output parameters aren't applicable at all, it must be something like this:

        let url = URL(string:baseURL.absoluteString + "/service_group?where=" + whereClause + "&max_results=" + String(maxResults))!

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