Skip to content

[PHP] ObjectSerializer conflict with Yii framework 1.1.17 #6353

@alex347

Description

@alex347
Description

Yii framework's class auto loader fails with the following error:
2017/08/22 09:54:44 [error] [php] include(int.php): failed to open stream: No such file or directory (vendor/yiisoft/yii/framework/YiiBase.php:432)
Stack trace:
#0 unknown(0): spl_autoload_call()
#1 vendor/example/lib/ObjectSerializer.php(68): method_exists()
#2 vendor/example/lib/ApiClient.php(156): sanitizeForSerialization

Swagger-codegen version

2.2.3

Swagger declaration file content or url
swagger: '2.0'
info:
  title: Example
  version: 1.0.0
produces:
  - application/json
paths:
  /example:
    post:
      parameters:
        - name: params
          in: body
          required: true
          schema:
            $ref: '#/definitions/RequestParams'
      responses:
        200:
          description: Success
definitions:
  RequestParams:
    properties:
      UserId:
        type: integer
Command line used for generation

swagger-codegen generate -i swagger.yaml -l php -o php

Steps to reproduce
  1. Install Yii framework 1.1.17
  2. Run example PHP client code from README.txt
Related issues/PRs

no

Suggest a fix/enhancement

Check if class exists before calling method_exists

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions