-
-
Notifications
You must be signed in to change notification settings - Fork 262
Closed
Labels
✨ enhancementNew feature or improvementNew feature or improvement🍭 OpenAPI ComplianceSupporting a new bit of the OpenAPI specSupporting a new bit of the OpenAPI spec
Description
Describe the bug
The generator doesn't seem to support array indices in $ref.
To Reproduce
openapi-python-client generate --path /tmp/bug.json
Generating bug-client
Warning(s) encountered while generating. Client was generated, but some pieces may be missing
ERROR parsing POST /alarms within default. Endpoint will not be generated.
Could not find reference in parsed models or enums
Reference(ref='#/paths/~1alarms/post/parameters/0/schema')
Expected behavior
The following $ref should resolve to the parameter's schema.
OpenAPI Spec File
{
"openapi": "3.0.1",
"info": {
"title": "Bug",
"version": "1.0"
},
"paths": {
"/alarms": {
"post": {
"parameters": [
{
"name": "X-ID",
"in": "header",
"schema": {
"type": "integer"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"$ref": "#/paths/~1alarms/post/parameters/0/schema"
}
}
}
}
}
},
"responses": {
}
}
}
}
}
Desktop (please complete the following information):
- OS: Ubuntu
- Python Version: 3.9
- openapi-python-client version 0.9.2
Metadata
Metadata
Assignees
Labels
✨ enhancementNew feature or improvementNew feature or improvement🍭 OpenAPI ComplianceSupporting a new bit of the OpenAPI specSupporting a new bit of the OpenAPI spec