Announcing a new endpoint that returns all publicly available Open API specifications

rhenry
HubSpot Employee

What’s happening?

We are delighted to share that developers can now access HubSpot’s Open API Specification.

Starting from the source code that powers the HubSpot application we generate public API documentation that describes our APIs using the Open API specification.

If you are curious or want to know more about HubSpot’s Open API specifications you can use the endpoint below to access the available specifications. Or you can read more here on the public API documentation .

GET: https://api.hubspot.com/api-catalog-public/v1/apis

Benefits of this launch:

 

  • Developers can now auto generate their own Client Libraries in over 40 languages (HubSpot currently offers support for Python, Node, Ruby, PHP)
  • Developers can also integrate with a number of open-source tools and integrations in the Swagger ecosystem

When is this happening? 

 

Access to HubSpot’s Open API specifications is available now. 

 

Please let us know if you have any feedback questions or by replying below.





Rahmona Henry
3 Replies 3
Lars-Erik
Contributor | Elite Partner

Awesome!
Thank you!
🎉👏🙏

0 Upvotes
Lars-Erik
Contributor | Elite Partner

I've built a tool to download all or a filtered set of the API specifications.
Using openapi-merge and openapi-generator, the tool can also merge and generate a client library for the given set of specs. It's not packaged up, but it can be cloned and used from here:
lars-erik/markedspartner.hubspot.net (github.com)

It works fairly well, the client classes are generated based on tags.
This puts things like contacts, companies and deals basic operations in the same class.
Seems fine.

 

There are a few issues though.

 

My biggest grief are the `operationIds`.
For instance the operationId `patch-/crm/v3/objects/contacts/{contactId}_update` is gingerly translated into `PatchCrmV3ObjectsContactsContactIdUpdate` in the client. I'm sure you've auto generated the operation ids out of convenience, but a more client friendly naming would be much prefered. I'm fairly reluctant to have to
mess with codegen templates in order to change the generated names.
It would be very nice if some care was given at the provider level. 😉

 

Second, there's a path that crashes with openapi-generator.

I've not dived in to figure out the hows and whys, but I suspect it's just the parameter name.

'/cms/v3/source-code/{environment}/validate/{path}'. Declared path parameter environment needs to be defined as a path parameter in path or operation level

 

Finally, there are a few invalid schema names blocking generation.
Seems the common error is that they include spaces in their names which is nott allowed.
Here's a dump of the errors:

 

Line ItemsBatchResponseSimplePublicObject doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
Line ItemsCollectionResponseWithTotalSimplePublicObjectForwardPaging doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
Line ItemsCollectionResponseAssociatedIdForwardPaging doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
Feedback SubmissionsCollectionResponseSimplePublicObjectWithAssociationsForwardPaging doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
Feedback SubmissionsSimplePublicObjectInput doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
Line ItemsBatchInputSimplePublicObjectInput doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
Feedback SubmissionsPaging doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
Contact PropertiesBatchResponseProperty doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
Line ItemsSimplePublicObject doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
Contact PropertiesOption doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
Line ItemsBatchInputSimplePublicObjectBatchInput doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
Line ItemsSimplePublicObjectBatchInput doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
Line ItemsCollectionResponseAssociatedId doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
Feedback SubmissionsNextPage doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
Line ItemsCollectionResponseSimplePublicObjectWithAssociationsForwardPaging doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
Line ItemsSimplePublicObjectInput doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
Feedback SubmissionsSimplePublicObjectWithAssociations doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
Feedback SubmissionsCollectionResponseWithTotalSimplePublicObjectForwardPaging doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
Feedback SubmissionsSimplePublicObject doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
Feedback SubmissionsCollectionResponseAssociatedId doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
Line ItemsForwardPaging doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
Deal PropertiesBatchResponseProperty doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
Feedback SubmissionsBatchInputSimplePublicObjectBatchInput doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
Feedback SubmissionsCollectionResponseAssociatedIdForwardPaging doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
Feedback SubmissionsBatchInputSimplePublicObjectInput doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
Feedback SubmissionsBatchResponseSimplePublicObjectWithErrors doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
Company PropertiesOption doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
Line ItemsSimplePublicObjectWithAssociations doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
Feedback SubmissionsBatchResponseSimplePublicObject doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
Line ItemsPaging doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
Line ItemsBatchResponseSimplePublicObjectWithErrors doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
Feedback SubmissionsSimplePublicObjectBatchInput doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
Deal PropertiesOption doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
Feedback SubmissionsForwardPaging doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
Line ItemsNextPage doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$

 

Hope these things can be addressed. It'll make for super simple generation of any nice client libs. 🤞

DHock
Member

Hi,
I have looked through many of the openapi specs and I don't see completed json schemas for requests and responses. There are just generic top level object placeholders and some example JSON.

Any plans to provide more complete schemas? I got them from https://api.hubspot.com/api-catalog-public/v1/apis

0 Upvotes