APIs & Integrations

twnk
Member

Generate java code using hubspot open API?

Good afternoon,

 

I received a job to access the hubspot api to create contacts and other objects. While looking for client libraries i found out there aren't any for java (ones that are officially maintained and mature).

 

The docs are quite clear, but json is schemales, the client libraries provide structure.

 

I looked at the php library which seems to be generated from an open api specs:

===

* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.

===

Is it possible to generate java classes using this open api generator?

 

Kind regards

0 Upvotes
3 Replies 3
quentin_lamamy
Key Advisor | Diamond Partner
Key Advisor | Diamond Partner

Generate java code using hubspot open API?

Hi @twnk ,

Thanks @dennisedson for the ping

 

I don't know if this is possible because i am not coding on Java sinc my studies something like 10 years ago ^^. Maybe zack have an idea on that. I will ask him on slack if he can take a look.


0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

Generate java code using hubspot open API?

Hello @twnk 

Welcome to the Community!

I wonder if @quentin_lamamy or @MatthewShepherd have some insights to share with you!

0 Upvotes
twnk
Member

Generate java code using hubspot open API?

Cheers @dennisedson , in the meantime i analyzed the request and response json, did build a few java pojo's and configured the serializer/deserializer to be relaxed when it comes to missing fields.

 

I considered using writing a few php scripts which use the php client library and call them from java using php cli, but it was a bit overkill considering the current state of our project and well php isn't very strict either.

 

But i'm still very interesting in a object tree generated by some openapi code generator. Especially with java it adds type safety and the contract is much more strict, which has all kinds of benefits when it comes to maintenance.