Skip to content
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-symfony doesn't set return model in doc-comment #12498

Open
artemvolt opened this issue Dec 4, 2024 · 0 comments
Open

php-symfony doesn't set return model in doc-comment #12498

artemvolt opened this issue Dec 4, 2024 · 0 comments

Comments

@artemvolt
Copy link

artemvolt commented Dec 4, 2024

Description

Hello!

I tried to create controllers interfaces and expect to see file like this https://github.com/swagger-api/swagger-codegen/blob/master/samples/server/petstore/php-symfony/SymfonyBundle-php/Api/PetApiInterface.php.

But after generation, i dont' see @return Swagger\Server\Model\Pet[]

/**
     * Operation findPetsByStatus
     *
     * Finds Pets by status
     *
     * @param  array $status  Status values that need to be considered for filter (required)
     * @param  int     &$responseCode    The HTTP Response Code
     * @param  array   $responseHeaders  Additional HTTP headers to return with the response ()
     *
     * @return array|object|null
     */
    public function findPetsByStatus(array $status, int &$responseCode, array &$responseHeaders): array|object|null;`

instead of:

/**
     * Operation findPetsByStatus
     *
     * Finds Pets by status
     *
     * @param  string[] $status  Status values that need to be considered for filter (required)
     * @param  integer $responseCode     The HTTP response code to return
     * @param  array   $responseHeaders  Additional HTTP headers to return with the response ()
     *
     * @return Swagger\Server\Model\Pet[]
     *
     */
    public function findPetsByStatus(array $status, &$responseCode, array &$responseHeaders);

Could you help me and say where is my mistake?

Swagger-codegen version

I tried to use v6.6.0 and latest version. Nothing happens.

Swagger declaration file content or url

I used content of file https://petstore.swagger.io/v2/swagger.json.

Command line used for generation
docker run --rm \
      -v /path/to/project:/local openapitools/openapi-generator-cli generate \
      -i /local/tmp/swagger.json \
      -g php-symfony \
      -o /local/tmp/swagger-generated
Steps to reproduce
docker run --rm \
      -v /path/to/project:/local openapitools/openapi-generator-cli generate \
      -i /local/tmp/swagger.json \
      -g php-symfony \
      -o /local/tmp/swagger-generated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant