Skip to content

[PHP] Invalid classes generated if models start with a digit #2392

@willemstuursma

Description

@willemstuursma

Some of the models start with a digit. E.g. a small part from my definition:

          "400": {
            "description": "Bad Request Data",
            "schema": {
              "$ref": "#/definitions/400ResponseModel"
            }
          },
          "401": {
            "description": "Unauthorized request",
            "schema": {
              "$ref": "#/definitions/401ResponseModel"
            }
          },

Apparently this works fine in some languages but for the PHP client it generates invalid classnames since PHP classes are not allowed to start with a digit:

/**
 * 400ResponseModel Class Doc Comment
 *
 * @category    Class
 * @description 
 * @package     Supplier\Cybersource
 * @author      http://github.com/swagger-api/swagger-codegen
 * @license     http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
 * @link        https://github.com/swagger-api/swagger-codegen
 */
class 400ResponseModel implements ArrayAccess
{
    /**
      * Array of property to type mappings. Used for (de)serialization 
      * @var string[]
      */
    static $swaggerTypes = array(
    /* ... */

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions