-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP Generator does not generate comma's between string array values #8345
Comments
Hello @Klyner007 , can you please check an example of your |
An example of what the generator generated, is the following:
I think this is default code which is not in the yml file I imported. |
I can reproduce this bug on https://editor.swagger.io and latest release 3.6.3 Spec: openapi: 3.0.0
info:
title: vzaar
description: Swagger document for generating vzaar's SDKs
version: "2.0"
servers:
- url: https://vzaar.com/api/v2
paths:
/videos:
get:
summary: Returns a list of videos.
description: Get videos in account with optional filter and sorting
responses:
'200':
description: A JSON array of videos
content:
application/json:
schema:
$ref: '#/components/schemas/Video'
components:
schemas:
Video:
type: object
properties:
id:
type: integer
example: 123
title:
type: string
example: "My Video"
description:
type: string
example: "Video Description"
protected static $swaggerTypes = [
'id' => 'int''title' => 'string''description' => 'string'
]; In short, component references are broken and when you try to use the client you get a PHP syntax error. |
hey @Klyner007 @richjenks i think this was fixed for recent codegen 3.0.0-SNAPSHOT but this version is still not used for editor. however can you please check and let me knnow if it still present? thanks! |
@HugoMario half fixed~ 3.0.0-SNAPSHOT/swagger-codegen-cli-3.0.0-20180710.190537-87.jar
but still busted here..
|
Hi, I have similar problem in version 3.0.3. It's not generate commas properly in method parameters: generated code: /**
* Operation changePublicationStatusUsingPUT
*
* Modify multiple offers publication at once.
*
* @param \GreenCell\AllegroRestApiClient\Model\PublicationChangeCommandDto $body publicationChangeCommandDto (required)
* @param string $commandId commandId (required)
*
* @throws \GreenCell\AllegroRestApiClient\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \GreenCell\AllegroRestApiClient\Model\GeneralReport
*/
public function changePublicationStatusUsingPUT($body$commandId)
{
list($response) = $this->changePublicationStatusUsingPUTWithHttpInfo($body$commandId);
return $response;
} Do you know anything about this problem? How now can I modify templates for |
@bnowak (Solution may only apply to Spring/SpringBoot). It's not great, but it looks like this problem was introduced after 3.0.0. Try reverting version back from 3.0.3 to 3.0.0 and see if this is fixed for you. |
@hampsterx , can you please check again? i checked this for 3.0.4 and it's fixed. going to close it but let me know if the issue is still present and i'll work on it. |
@HugoMario are you sure it's fixed? I'm running
EDIT: just updated my container, it's fixed in 3.0.5 |
it works in 3.0.5 |
Description
When generating a project, the generated models contain array properties which are not formatted right. Between multiple array values there should be a comma but it is not there.
Swagger-codegen version
3.0.0 SNAPSHOT
The text was updated successfully, but these errors were encountered: