-
-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Labels
Description
When referencing a component via $ref as a param type, the resolved datatype on the parameter (accessed via allParams) is number and isEnum is false.
Now with this resulting model there's no possibility to correctly resolve the enum name.
Consider the following schema:
...
'/user/{type}':
get:
tags:
- GetUsers
summary: GetUsersByType
operationId: GetUsersByType
parameters:
- name: type
in: path
required: true
schema:
$ref: '#/components/schemas/UserType'
responses:
'200':
...
components:
schemas:
UserType:
enum:
- 0
- 1
- 2
- 3
- 4
- 5
type: integer
format: int32
x-enum-varnames:
- TypeA
- TypeB
- TypeC
- TypeD
- TypeE
- TypeF
This is the result:
"allParams": [
{
"isHeaderParam": false,
"isQueryParam": false,
"isPathParam": true,
"isBodyParam": false,
"isFormParam": false,
"paramName": "type",
"baseName": "type",
"required": true,
"optional": false,
"dataType": "number",
"%dataType%": "number",
"format": "int32",
"enum": [
0,
1,
2,
3,
4,
5
],
"example": "0",
"isBoolean": false,
"isPrimitiveType": false,
"dataFormat": "int32",
"isDate": false,
"isDateTime": false,
"description": "",
"isFile": false,
"isEnum": false,
"vendorExtensions": {},
"-first": true,
"-last": false,
"hasMore": true
}
]
zendext