DoclerLabs / api-client-generator

API client generator is a console application capable of generating an API client based on OpenAPI(Swagger) specification.
MIT License
31 stars 19 forks source link

RequestBody error on GET method generation #98

Closed abolabo closed 8 months ago

abolabo commented 11 months ago

Hi. Found error during code generation Error on mapping getSingleTrackResponseUsingGET: Argument 1 passed to DoclerLabs\ApiClientGenerator\Naming\SchemaNaming::getClassName() must implement interface cebe\openapi\SpecObjectInterface, null given, called in /var/www/github/api-client-generator/src/Input/Fact
ory/RequestFactory.php on line 61 when trying UPS spec https://github.com/UPS-API/api-documentation/blob/main/Tracking.json I see that method is GET and no Request Body schema provided (see line 85) Is it bug of api-client-generator of bug of spec? Please suggest..

vsouz4 commented 10 months ago

indeed spec for getSingleTrackResponseUsingGET looks a bit off, it's a GET request so there's no requestBody, meaning spec should omit this:

        "requestBody": {
          "description": "",
          "required": true,
          "content": {
            "application/json": {}
          }
        },