jhthorsen / openapi-client

A client for talking to an Open API powered server
11 stars 17 forks source link

Header parameter example #21

Closed ravenhall closed 4 years ago

ravenhall commented 5 years ago

The docs could really use an example of a header parameter when making an OpenAPI call.

jhthorsen commented 5 years ago

I'm not sure how to do that, without making a lot of different examples. The documentation states:

$params is optional, but must be a hash ref, where the keys should match a named parameter in the OpenAPI specification.

I thought that would read as any of the named parameters can be passed in, no matter if it's body, header, path or query. Can you help me make that more obvious?

jhthorsen commented 4 years ago

I'm closing this issue based on inactivity.

XSven commented 1 year ago

Replace the example

$tx = $client->listPets({limit => 10});

with

$tx = $client->listPets({"X-API-Key" => "abcdef12345", limit => 10});

That's it.