OpenAPI Specification

The announcement post for the new PHP SDK does not mention Open API anywhere. Is the new Square PHP SDK still auto generated from Open API Specification YAML?

https://swagger.io/blog/api-strategy/how-square-makes-its-sdks/

If not, is there any particular reason for switching from the auto generated SDK?

1 Like

We still do! We’re using Open API 3 instead of Open API 2 now. Additionally, our API Reference and API Explorer are 100% Open API 3 driven.

On the SDKs front, we are adding more customization to the generators to make them feel more like a hand-written one, and are working to make them reflect the coding styles of the respective Ruby, Python, PHP, Java, .NET communities.

1 Like

The new SDK looks much better than the old one.

Is it still generated from the OpenApi specification in

Update: I checked the square/connect-api-specification repo and found that the repo is for the old SDK.

Is the tooling that you are using to generate the new SDK open source / available on GitHub?

Nope, we’re working with a vendor APImatic now so it’s closed source on the generation side.

We can look into publishing our Open API 3 specifications going forward if that’d be of use to you, though.

The SDK looked much different from the output generated by openapi-generator. So I just wanted to know if such customizations were possible with openapi-generator.

Thank you for the clarification.

That would be much appreciated. Thank you.

You may consider customizing the mustache templates (and of course the generators written in Java) in openapi-generator if the default output doesn’t meet your requirement.

That would be great! Is this already in the works?

It’s currently on our roadmap, but we don’t have an estimate on when it’ll be available yet.

Is there any update? I did a search but couldn’t find the opeanpi spec file.

We want to generate Rust SDK to access the Square API.

Yes, we use the Square-connect-go-SDK is what we use to generate our SDKs. :slightly_smiling_face:

Thanks for the pointer. I found https://raw.githubusercontent.com/square/square-connect-go-sdk/master/swagger/api/swagger.yaml in the repo but the there are validation errors in the spec according to swagger editor.

Hi Bryan, any chance you can share the URL to the official OpenAPI spec describing the Square API?

Thank you.

The Square-connect-go-SDK is what we use to generate our SDKs. :slightly_smiling_face:

Looks as if this repo has been archived. Is go unsupported by Square now?

We haven’t truly had a fully supported go SDK. We hope to have more for you in the future. :slightly_smiling_face: