Closed BirknerAlex closed 3 years ago
Hey,
I've been trying to use swac to generate an API client for Netbox. The OpenAPI documentation can be found under https://netboxdemo.com/api/docs/?format=openapi.
swac
A generated getResponse() method looks like this:
/** * @return mixed * @throws RestException * @throws InvalidValue * @throws Exception * @throws GuzzleException */ public function getResponse() { $raw = $this->getRawResponse(); $statusCode = $raw->getStatusCode(); switch ($statusCode) { default: throw new RestException('Unsupported response status code: ' . $statusCode, RestException::UNSUPPORTED_RESPONSE_CODE); } return $result; }
It seems the switch case for status code 200 is missing but the OpenAPI response does contain a status 200 in the json. So every successful call does throw the Unsupported response status code Exception.
Unsupported response status code
@BirknerAlex please try v0.1.26.
v0.1.26
Looks good, thanks for the fast fix!
Hey,
I've been trying to use
swac
to generate an API client for Netbox. The OpenAPI documentation can be found under https://netboxdemo.com/api/docs/?format=openapi.A generated getResponse() method looks like this:
It seems the switch case for status code 200 is missing but the OpenAPI response does contain a status 200 in the json. So every successful call does throw the
Unsupported response status code
Exception.