Comments (5)
Hi @ksaritek
We are aware that standard code generators don't handle the MS Dateformat that we return from our Accounting APIs.
We are building our SDKs from these OpenAPI specs and have modified our mustache templates to work around these and convert them into native date or date-time. We do have plans to remove the format: date and format: date-time in the future so these would be simple "strings". This change isn't happening yet as we need to modify our mustache templates for 5 SDKs to use vendorExtensions and not rely on the format:date and date-time.
Of course, once the change is done you'd still have to handle the conversion of these strings into dates, but it should allow for code generation.
Final caveat, our Accounting API is over a decade old and predates Swagger and OpenAPI specs. For this reason, we've been reverse engineering these specs. There are inherent quirks in our APIs that are not easily addressed in OpenAPI specs and therefore your mileage may vary when using an off the shelf code generator.
from xero-openapi.
Hi @SidneyAllen, Thanks for the reply. So I will do the same modification for the GoLang, right?
Final caveat, our Accounting API is over a decade old and predates Swagger and OpenAPI specs. For this reason, we've been reverse engineering these specs. There are inherent quirks in our APIs that are not easily addressed in OpenAPI specs and therefore your mileage may vary when using an off the shelf code generator.
Up to your comment, should I continue with OpenAPI specs or not? I confused a little bit.
from xero-openapi.
@ksaritek - Not sure what you mean by same modification. If you have access to the mustache templates you are using to generate the code, then YES, you can make modifications. Some folks are using online code generators and don't have that option.
In the near term, if you want to fork this repo and wish to find and remove all format: date and format: date-time you are free too. We will be making that change in the future.
Yes, you can continue to use the OpenAPI spec, but I want to be fully transparent that there are quirks in the API - but for the most part it should work (heck we are using it to generate our SDKs 😄 )
For example our Invoices endpoints supports getting and invoice as JSON OR as a PDF. But with strongly typed language you need to pick one and OpenAPI spec only allows a path to be defined once in a spec.
So, "getInvoiceAsPDF" is a method that uses the path /invoices/{invoiceID}/pdf (and we added a vendor extension x-path: /invoices/{invoiceID}. In our template if x-path exists, we substitute it for the defined path.
I'm not trying to worry you because the spec should mostly work for you and using standard templates (once the date issue is sorted) but there may be other things we've worked around.
Hope that clarifies things.
from xero-openapi.
👍 yep that clarifies things
from xero-openapi.
@ksaritek - hope you are well.
I've begun work to changing MSJSON dates into just Strings in our OpenAPI spec.
Here is my work in progress - branch
https://github.com/XeroAPI/Xero-OpenAPI/tree/accounting-date-as-string
In the future we'll merge this into master, but I don't have an ETA yet.
from xero-openapi.
Related Issues (20)
- Missing POST BatchPayments
- Collect HOT 1
- Get Invoices paging with IDs HOT 6
- Couldn't create Credit Card account through XERO Accounting API HOT 1
- Github actions test issue HOT 1
- Another github action test with account outside of org HOT 1
- Actions test HOT 2
- more testing HOT 2
- test test test HOT 2
- test
- test HOT 2
- Create Invoice is missing eInvoicing Field HOT 2
- Country in Organisation Address HOT 1
- Unable to build Go SDK from OpenAPI (failures in accounting schema) HOT 4
- Asset Type definition inconsistent with Xero interface HOT 2
- Asset depreciationStartDate not setting HOT 2
- Empty array with status 200 is returned when calling /connections endpoints HOT 4
- AU Payroll API LeaveApplicationID changes when a request is in Scheduled status HOT 3
- LineItems: DiscountRate returned but DiscountAmount does not depending on invoice call query HOT 2
- Organisation Class enum values need updated HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xero-openapi.