Skip to content

Parsing request bodies problematic? #2575

@unlikenesses

Description

@unlikenesses

Given the following endpoint:

'/cats/deflea':
    post:
      responses:
        '201':
          description: OK
      requestBody:
        $ref: '#/components/requestBodies/CatBody'

with the following request body:

requestBodies:
    CatBody:
      content:
        application/json:
          schema:
            type: object
            required:
              - catId
            properties:
              catId:
                type: integer

when I generate a php-laravel or python server stub, the catId parameter seems not to be recognised/parsed correctly, instead appearing as uNKNOWNBASETYPE.

Laravel:

public function defleaCat()
{
    $input = Request::all();
    //path params validation
    //not path params validation
    $uNKNOWNBASETYPE = $input['uNKNOWNBASETYPE'];
    return response('How about implementing defleaCat as a post method ?');
}

Python:

def deflea_cat(self, **kwargs):  # noqa: E501
    >>> thread = api.deflea_cat(async_req=True)
    >>> result = thread.get()

    :param async_req bool
    :param UNKNOWN_BASE_TYPE unknown_base_type:
    :return: None
    kwargs['_return_http_data_only'] = True
    if kwargs.get('async_req'):
        return self.deflea_cat_with_http_info(**kwargs)  # noqa: E501
    else:
        (data) = self.deflea_cat_with_http_info(**kwargs)  # noqa: E501
        return data

Is this intentional? I could be missing something obvious here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions