Repository navigation
'invalid data in items of array legs' when parsing openapi spec #513
Copy link
Copy link
Closed
Labels
🐞bugSomething isn't workingSomething isn't working
Milestone
Description
Describe the bug
When parsing this openapi spec, get the following error and warnings:
Error
Unable to parse this part of your OpenAPI document:
invalid data in items of array legs
Reference(ref='#/components/schemas/OrderObject')
Warnings
Warning(s) encountered while generating. Client was generated, but some pieces may be missing
WARNING parsing GET /accounts/{account_id} within accounts. Endpoint will not be generated.
Incorrect path templating for /accounts/{account_id} (Path parameters do not match with path)
WARNING parsing DELETE /accounts/{account_id} within accounts. Endpoint will not be generated.
Incorrect path templating for /accounts/{account_id} (Path parameters do not match with path)
WARNING parsing PATCH /accounts/{account_id} within accounts. Endpoint will not be generated.
Incorrect path templating for /accounts/{account_id} (Path parameters do not match with path)
WARNING parsing POST /accounts/{account_id}/documents/upload within accounts. Endpoint will not be generated.
Incorrect path templating for /accounts/{account_id}/documents/upload (Path parameters do not match with path)
WARNING parsing GET /trading/accounts/{account_id}/account within accounts. Endpoint will not be generated.
Incorrect path templating for /trading/accounts/{account_id}/account (Path parameters do not match with path)
WARNING parsing DELETE /accounts/{account_id}/recipient_banks/{bank_id} within accounts. Endpoint will not be generated.
Incorrect path templating for /accounts/{account_id}/recipient_banks/{bank_id} (Path parameters do not match with path)
WARNING parsing GET /accounts/activities/{activity_type} within accounts. Endpoint will not be generated.
Incorrect path templating for /accounts/activities/{activity_type} (Path parameters do not match with path)
WARNING parsing GET /accounts/{account_id}/ach_relationships within accounts. Endpoint will not be generated.
Incorrect path templating for /accounts/{account_id}/ach_relationships (Path parameters do not match with path)
WARNING parsing POST /accounts/{account_id}/ach_relationships within accounts. Endpoint will not be generated.
Incorrect path templating for /accounts/{account_id}/ach_relationships (Path parameters do not match with path)
WARNING parsing DELETE /accounts/{account_id}/ach_relationships/{ach_relationship_id} within accounts. Endpoint will not be generated.
Incorrect path templating for /accounts/{account_id}/ach_relationships/{ach_relationship_id} (Path parameters do not match with path)
WARNING parsing GET /trading/accounts/{account_id}/orders within trading. Endpoint will not be generated.
Incorrect path templating for /trading/accounts/{account_id}/orders (Path parameters do not match with path)
WARNING parsing POST /trading/accounts/{account_id}/orders within trading. Endpoint will not be generated.
Incorrect path templating for /trading/accounts/{account_id}/orders (Path parameters do not match with path)
WARNING parsing DELETE /trading/accounts/{account_id}/orders within trading. Endpoint will not be generated.
Incorrect path templating for /trading/accounts/{account_id}/orders (Path parameters do not match with path)
WARNING parsing GET /trading/accounts/{account_id}/orders/{order_id} within trading. Endpoint will not be generated.
Incorrect path templating for /trading/accounts/{account_id}/orders/{order_id} (Path parameters do not match with path)
WARNING parsing DELETE /trading/accounts/{account_id}/orders/{order_id} within trading. Endpoint will not be generated.
Incorrect path templating for /trading/accounts/{account_id}/orders/{order_id} (Path parameters do not match with path)
WARNING parsing PATCH /trading/accounts/{account_id}/orders/{order_id} within trading. Endpoint will not be generated.
Incorrect path templating for /trading/accounts/{account_id}/orders/{order_id} (Path parameters do not match with path)
WARNING parsing GET /trading/accounts/{account_id}/positions within trading. Endpoint will not be generated.
Incorrect path templating for /trading/accounts/{account_id}/positions (Path parameters do not match with path)
WARNING parsing GET /accounts/{account_id}/documents/{document_id}/download within documents. Endpoint will not be generated.
Incorrect path templating for /accounts/{account_id}/documents/{document_id}/download (Path parameters do not match with path)
WARNING parsing POST /accounts/{account_id}/recipient_banks within funding. Endpoint will not be generated.
Incorrect path templating for /accounts/{account_id}/recipient_banks (Path parameters do not match with path)
To Reproduce
- Run the command:
openapi-python-client generate --url https://raw.githubusercontent.com/alpacahq/bkdocs/master/assets/openapi.yaml - See the terminal output
Expected behavior
No errors
OpenAPI Spec File
https://raw.githubusercontent.com/alpacahq/bkdocs/master/assets/openapi.yaml
Desktop (please complete the following information):
- OS: macOS 11.5.1
- Python Version: 3.9.7
- openapi-python-client version: 0.10.5
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
🐞bugSomething isn't workingSomething isn't working
Activity
dbanty commentedon Oct 12, 2021
Thanks for reporting! I'm going to do a sweep of PRs and bugs this weekend so I'll try and get this one in too.
dbanty commentedon Oct 17, 2021
Alright, I've reproduced the issue and figured out where it's coming from!
OrderObjectis a recursive schema that, unfortunately, isn't supported yet (see #466). There have been a few attempts to implement it but, alas, none of them have quite worked out.It's definitely on the roadmap to fill that gap, but I have no idea when it'll get done.
The "good" news is that is only a warning (at least when I run it), so the rest of the client that is supported will be generated. Of course that's only good news if you don't need that particular schema 😅.
Sorry about that, I'm going to use this as an opportunity to make that error message a bit clearer.