-
Notifications
You must be signed in to change notification settings - Fork 137
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
Collaborate on "newer" version, though slightly different direction? #88
Comments
@lars-erik I think this sounds great! However, we have been trying to support the full specification of HubSpot's API's just have not had the manpower to fully close the gap quite yet. I think meeting an OpenAPI spec is great, granted that we have one. Have you taken a look at what we are currently doing? We are focused on making this project strongly-typed (you may have seen an earlier version which was based solely on We have been trying to abstract away the request/response piece and allow developers consuming this project to use it like an SDK. What are your thoughts on that? |
🙌
As mentioned, it's coming. I've got a simple one for now against the V3 API, and it only supports list / get for the main entities.
I have. My biggest turn off is RestSharp. Not that I got anything against it, but I don't see the benefit over pure HttpClient usage. That being said, I wouldn't mind having a simple mapping library available. For instance like so:
Whether the properties to load should be a params array or you then would use a parameter object is a very good question. I favor the latter, but defo. see the beauty of passing parameters for such a "small" API call. I believe NSwag let's us choose between both. I guess the biggest thing to agree on is how the generated clients should look. Maybe one for each style? Extensions?
I don't see a mismatch between Request / Response and SDKs. 😉 I just publicized the small V3 prototype I did with OpenAPI / NSwag. In order to get "good integration tests", I think it'd be nice to have a onetime setup that seeds a developer portal and then runs against equally generated data each time. I don't see any reason for doing mock testing here, but possibly using a stubbed HttpClientManager. Again, the repo linked is a totally new prototype for the V3 API. I think we'll keep our V1/V2 stuff neatly tucked away in our internal SCM. 😉 Hope this makes sense, and would really love to have a joint effort for HS APIs on the .NET platform. |
Yeah I get that. I'm not necessarily tied to this. I see the benefit for using I actually just created #89 for just this reason.
Right, we don't want to support that type of use case either. We really just support the generic shape of custom properties from the API. See ContactProperty for more information. Yeah I don't think it should be our responsibility to handle typing the value of these properties to a custom class the consumer will make. But a mapper could be interesting. If you feel interested enough in that, go ahead and log an issue for it! If you're up for working with us, we'd be glad to have you along! |
Sounds like we're quite aligned. :) I'll keep hacking at the OpenAPI stuff for a while until it stabilizes. Maybe see about aligning APIs and methods when HubSpot launches an official spec? At least if it happens H1 2021. 😜 |
I've just been converting a Zendesk Sell API library to use strong types with RestSharp. It's .NET Standard but I'm also a Hubspot user and I'd like to help contribute too. |
@lars-erik @jamiehowarth0 let's do it! |
@Psypher9 If only there were news. :) |
https://developers.hubspot.com/changelog/get-all-publicly-available-open-api-specifications code generation using NSwag produces invalid code RicoSuter/NSwag#3363 RicoSuter/NSwag#3362
|
@ma3yta thanks for the update! @lars-erik it looks like we've got the Open API specs now! |
@Psypher9 We do. 🎉 Looks like @ma3yta's suggestion about open api tools is a good one. I didn't have the best xp. with NSwag. |
Hi all, I've gotten a bit further with this. I've got a "CLI" that downloads specified endpoints. For now I pipe one to file. So fairly close. :) |
There! 🥳 I can now type
in the repo above, get a merged API spec from openapi-merge and then an openapi-generator generated C# (4.5.2) solution spat out based on the I'm not overly satisfied with the method names, but if nothing better, openapi-generator can be "templated" in order to change how the C# naming is done. Not sure if we could provoke the "Api classes", which seem to be based off tags. In any case, I'm super happy to have something to automate the entire process. Hope to hear your thoughts, and possibly even some teamwork to see about making something "proper and automated" from this. (Oh, BTW, unless the entire template is modified, it seems RestSharp is there to stay. 😇) |
I've bugfixed and polished a bit, and the tool can now generate a full solution of all the APIs from one merged spec. The only thing left for this to actually be kind of good is to find a fix for the operationIds. I've posted some feedback on the developer announcement thread. Will wait for feedback there before doing anything else. Let me know your thoughts. |
I'm slightly miffed that the ecommerce API isn't yet there, but very happy that the OpenAPI specs are now freely available! |
Hi ya'll!
I work for a diamond HubSpot partner in Norway. Of course we have our own .NET client as I'm sure a lot others have built over the last five years. Happy to see there is a community based open source initiative for this. On a sidenote, there's a .NET Core client in the works in another repo: https://github.com/skarpdev/dotnetcore-hubspot-client.
Fairly recently I submitted an idea to HubSpot to try to get them to publish an OpenAPI spec. of their v3 API at least. This is under review and hopefully likely to happen: https://community.hubspot.com/t5/HubSpot-Ideas/Publish-OpenAPI-specifications-for-the-APIs/idi-p/306942
With a full OpenAPI spec. we'll be able to use tools like NSwag to generate clients. Personally I prefer mirroring a kind of request / response structure, though with strictly typed classes. The properties collections would have to be dictionaries of course. But this is easy to build a mapper for afterwards.
I've currently started a temporary OpenAPI spec while waiting for an official one, and have a fairly nice client for the general list / get scenarios. It can easily be tested both integrated and stubbed using ApprovalTests.
My big question is: would you be interested in collaborating in a direction where OpenAPI is the "baseline"?
On a sidenote, I also have a powershell toolset based on the client which hopefully would be kind of similar to generate with a good base.
Hope this is interesting.
In any case, I'm working on something like this and if you want, I'd gladly cooperate rather than publishing a "competing" package. Not that competition isn't fruitful, but still. 🙂
Lars-Erik
The text was updated successfully, but these errors were encountered: