-
Notifications
You must be signed in to change notification settings - Fork 95
Referenced Parameters compiling to Object instead of Array #155
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
Comments
which part of the example code gets parsed as object instead of array? |
@cebe |
I have investigated this but could not reproduce this. I also added a test to confirm all you have said but all passed. |
It's been a while since I looked at this. I'm on a different project now and using swagger-php. |
I can confirm that this issue exists and I found its steps to reproduce. This issue does not exist while just reading the spec so the test at https://github.com/cebe/php-openapi/pull/195/files#diff-9a382adb08bd4ed5cb895893615a9e35da556f181b7a549f8e48e191702356a9 will pass and it is completely OK. While running
the generated output file contains parameters:
'1':
name: organizationId
in: path
description: 'The Organization ID'
required: true
schema:
type: string
format: uuid
'0':
name: api-version
in: header
description: 'The API version'
required: false
schema:
type: string
format: date
example: '2021-05-18'
instead of parameters:
- name: organizationId
in: path
description: 'The Organization ID'
required: true
schema:
type: string
format: uuid
- name: api-version
in: header
description: 'The API version'
required: false
schema:
type: string
format: date
example: '2021-05-18' So fix should be made in |
I am having an issue with parameters being compiled as an object instead of an array. This is invalid OpenAPI.
I am using references heavily.
I have many different yaml files that are referenced by the primary spec so it is easy to maintain.
Each endpoint has parameters, which usually point to another file since they are used everywhere.
When a parameter reference points to something within the same file, the compiled parameter
Example Code (one of the referenced files) that does not work. It compiles to an object that has numbered keys.
Example Code (one of the referenced files) that does work. It compiles to an array.
The text was updated successfully, but these errors were encountered: