-
Notifications
You must be signed in to change notification settings - Fork 125
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
Unable to build Go SDK from OpenAPI (failures in accounting schema) #563
Comments
PETOSS-307 |
Thanks for raising an issue, a ticket has been created to track your request |
In addition, after taking advice - I tried using redoc to reformat the YAML before parsing but that gets sad too: $ redocly bundle --dereferenced xero_accounting.yaml > new.yaml
bundling xero_accounting.yaml...
📦 Created a bundle for xero_accounting.yaml at stdout 267ms.
$ go run github.com/getkin/kin-openapi/cmd/validate@latest -- new.yaml
2023/06/23 11:56:27 error converting YAML to JSON: yaml: anchor 'ref_20' value contains itself
exit status 1 |
After the linked issue was solved I was able to generate types using oapi-codegen:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh Oh - no matter the tools, we're unable to generate a buildable SDK for Golang using the Xero OpenAPI schema.
The previous SDK is deprecated and we're looking to accelerate our development using the official tooling from Xero.
Is there a known working process you guys are able to share that outlines the process, i've worked in the space for a while and this is the first time that all tools seem to be unable to parse spec files and give something buildable 😬
Expected Behavior
Ability to build a working Golang SDK/client from the in-repo schema
Current Behavior
When building with either the recommended tool - https://github.com/OpenAPITools/openapi-generator or the popular tool
oapi-codegen
from https://github.com/deepmap/oapi-codegen - many issues arise due to the way that the schema has been structured.The below is one example trying to validate the schema using a common tool.
Possible Solution
I wrote a script to contribute that i'll paste below that can go some way to generating the required SDK - including commented out ability to switch generators as needed:
However these result in duplicate values in packages, unresolvable references or bad type definitions.
Context
We are currently building a financial services integration and would like to be able to use Xero as an approved accounting platform.
Your Environment
main
Chrome or Safari - any
The text was updated successfully, but these errors were encountered: