Skip to content

'invalid data in items of array legs' when parsing openapi spec #513

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

Closed
br-follow opened this issue Oct 12, 2021 · 2 comments
Closed

'invalid data in items of array legs' when parsing openapi spec #513

br-follow opened this issue Oct 12, 2021 · 2 comments
Labels
🐞bug Something isn't working
Milestone

Comments

@br-follow
Copy link

br-follow commented Oct 12, 2021

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

  1. Run the command:
    openapi-python-client generate --url https://raw.githubusercontent.com/alpacahq/bkdocs/master/assets/openapi.yaml
  2. 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
@br-follow br-follow added the 🐞bug Something isn't working label Oct 12, 2021
@dbanty dbanty added this to the 0.10.6 milestone Oct 12, 2021
@dbanty
Copy link
Collaborator

dbanty commented 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
Copy link
Collaborator

dbanty commented Oct 17, 2021

Alright, I've reproduced the issue and figured out where it's coming from! OrderObject is 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants