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

how to generate an empty array instead of an empty object? #591

jinseokoh opened this Issue Oct 5, 2018 · 1 comment


None yet
2 participants

jinseokoh commented Oct 5, 2018

With the following annotations,

     * @OA\SecurityScheme(
     *     type="apiKey",
     *     in="header",
     *     securityScheme="api_key",
     *     name="api_key"
     * )
     * @OA\Post(
     *     path="/api/v1/create",
     *     security={
     *       {"api_key":{}}
     *     },
     *     @OA\Response(
     *         response="default",
     *         description="successful operation"
     *     )
     * )

it generates

          api_key: {  }

while the expected output based on OpenApi v3 documentation is as follows:

      - api_key: [] 

How can I produce an empty array instead of empty object? This Doctrine annotation's pretty confusing.


This comment has been minimized.


bfanger commented Oct 12, 2018

The bug was in the yaml conversion, that one converted the empty array to an empty object.

I've added the Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment