Comments (9)
@madison890000 Got it, and thanks for the more thorough explanation.
I may try that route, obviously there is a way the original generator is doing that, so it's probably something we need to change in the configuration. Thanks for your help thus far.
from xero-node.
PETOSS-350
from xero-node.
Thanks for raising an issue, a ticket has been created to track your request
from xero-node.
I just fix this issue manually updated the code in https://github.com/madison890000/xero-node.
Here is the npm link I published: https://www.npmjs.com/package/fix-xero-node.
You can use it by replacing
"xero-node": "4.35.0"
to
"fix-xero-node": "4.36.1"
.
I have only made 3 changes:
- first is to move the new parameter "idempotencyKey" to the second-to-last position, just before the headers parameter.
this means no changes need to be done when updating from 4.35.0 to 4.36.0. - second is deleting the Idempotency-Key in header if it is null/undefined.
this means no need to add idempotencyKey if you don't want to. and it will ignore it as well if it is set to be null/undefined. - manually export most of the types in gen model.
you can check the details in madison890000#3
You should be careful if you just want to fix Project API Types issues and your last verson is "xero-node": "4.36.0"
, because fix-xero-node 4.36.1
has also fix the idempotencyKey issue(only exist in "xero-node": "4.36.0"
) by moving the new parameter "idempotencyKey" to the second-to-last position. That means you need check the order of params if you are using idempotencyKey in some API functions.
It should be works fine if you are upgrade xero-node from 4.35.0.
from xero-node.
@madison890000 Really appreciate that.
Would you be willing to do a pull request back to upstream? We are extremely reliant on the Xero API, and we would prefer to get all the updates from the main line.
from xero-node.
@madison890000 Really appreciate that.
Would you be willing to do a pull request back to upstream? We are extremely reliant on the Xero API, and we would prefer to get all the updates from the main line.
I apologize for the inconvenience, but unfortunately,
(https://github.com/XeroAPI/xero-node#participating-in-xeros-developer-community)
it is not possible to fulfill a new request. The code for this SDK is automatically generated from the OpenAPISpec and is not maintained manually by the developer.
And I have no background about how to update the OpenAPISpec to fix this issure.
from xero-node.
@madison890000 So, the way the main-line API does it is by exporting the generated models right at the index level:
https://github.com/XeroAPI/xero-node/blob/master/src/index.ts#L2C47-L2C47
I think it would be as simple as doing this with projects and other models. I just want to understand what the maintainers had in mind by not doing this.
Also, there is a likelihood for name collision. So there may need to be some renaming or a submodule export approach.
Open to different options here, I just want a build system to ensure the project models are packaged as first-class exports.
from xero-node.
@madison890000 So, the way the main-line API does it is by exporting the generated models right at the index level:
https://github.com/XeroAPI/xero-node/blob/master/src/index.ts#L2C47-L2C47
I think it would be as simple as doing this with projects and other models. I just want to understand what the maintainers had in mind by not doing this.
Also, there is a likelihood for name collision. So there may need to be some renaming or a submodule export approach.
Open to different options here, I just want a build system to ensure the project models are packaged as first-class exports.
Yeah, that's actually how I do it in this PR: madison890000#3. Initially, it confused me why the maintainers were using the old way instead of the way we had in mind.
After exploring OpenAPI-generator, I realized that the maintainers simply defined the OpenAPI docs, which determine how the RESTful API works. The OpenAPI-generator can then automatically generate SDKs for different platforms like Java, NodeJS, .Net, and Python. This suggests that the maintainers focus more on considering and maintaining the overall functionality. They prefer to fix bugs on all platforms rather than just one.
Therefore, it becomes more challenging to have the maintainers fix issues compared to fixing them manually (which is why I forked this repo).
If you have any good ideas or solutions to fix this issue, feel free to try by creating a PR in https://github.com/XeroAPI/Xero-OpenAPI.
from xero-node.
I am going to keep the issue open to see if there are other ideas, I may also do one at the API generator level.
from xero-node.
Related Issues (20)
- idempotencyKey parameter introduced in 4.36.0 breaks existing calls to accounting api HOT 10
- Syntax Error in Readme Documentation HOT 3
- Cannot compile: HOT 3
- Url is not saved on invoice create HOT 2
- error TS7016: Could not find a declaration file for module 'request'. HOT 4
- Tracking not exposed on Typescript invoice object HOT 2
- The request package used by Node 4.3.0 is depreciated HOT 6
- "Missing function" HOT 3
- `Cannot read properties of undefined (reading 'defaultPort')` when used with `nock` HOT 10
- The type of Contact of "xero-node" module is not matched with API docs. HOT 2
- Converting circular structure to JSON HOT 3
- Switch from `request` to `axios` is a breaking change? HOT 7
- "createInvoiceAttachmentByFileName" Create attachment but not correct content file HOT 23
- CORS ERROR HOT 4
- Xero Node.js SDK: Inconsistent State Key Handling on Reconnection HOT 2
- Can you please upgrade openid-client to the latest (currently 5.6.5) HOT 3
- Attempt to parse object as JSON results in "JSON parse body failed" written to console HOT 3
- Unable to upload documents from Readable stream HOT 6
- Xero-node pagination doesn't work HOT 2
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-node.