Comments (4)
hey @shubhindia :)
Some context:
sdk.Client
was designed with API versioning in mind, so direct API calls like CreateProject
are located under sub-structs holding the logic for specific endpoints.
So sdk.Client.Objects
holds endpoints for objects related API set, while sdk.Client.Objects.V1
is used to access v1 versions of this API. Each returns a concrete struct without any means to change it's output, so enabling you to mock these would require some changes on our side, as you pointed out.
I need to think about it, I'll get back to you once I have an idea.
from nobl9-go.
Totally understandable :) I've already got a POC set up, I'll also add some docs which explain how to best/most easily mock the Client.
from nobl9-go.
hey @shubhindia :)
Some context:
sdk.Client
was designed with API versioning in mind, so direct API calls likeCreateProject
are located under sub-structs holding the logic for specific endpoints.So
sdk.Client.Objects
holds endpoints for objects related API set, whilesdk.Client.Objects.V1
is used to access v1 versions of this API. Each returns a concrete struct without any means to change it's output, so enabling you to mock these would require some changes on our side, as you pointed out.I need to think about it, I'll get back to you once I have an idea.
Thanks @nieomylnieja.
Currently we are just doing CRUD over Projects so its manageable but we can't just keep on writing WrapperFunctions
for calling ActualClientFunctions
as API grows. I mean we can but it's not really feasible.
from nobl9-go.
hey @shubhindia, happy to announce that v0.80.0 ships with an adjusted sdk.Client
API which allows mocking the entire client.
I've also included an example/documentation on how to achieve that: https://github.com/nobl9/nobl9-go/tree/main/docs/mock_example.
I hope this meets your needs :) Let me know If you have any more questions on that and If it solved your issue!
from nobl9-go.
Related Issues (4)
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 nobl9-go.