openapi-generator
openapi-generator copied to clipboard
[php] Question on schema->class Name
Hi there,
My OpenAPI schema looks like this:
...
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/_default"
}
}
}
},
....
"components": {
"schemas": {
"_default": {
"type": "object",
"title": "DefaultResponse",
"properties": {
"msg": {
"type": "string",
"description": "Message to return on routes, without response data",
"example": "done"
}
}
},
...
Which results in invalid PHP Code:
class Default implements ModelInterface, ArrayAccess, \JsonSerializable
{
....
protected static $openAPIModelName = '_default';
...
Of course "default" is reserved in PHP, but my actual Schema is not called "default". Is there a way to use the title "DefaultResponse" as Class-Name?
Thanks a lot!