Skip to main content

CodeGen FAQs

How does APIMatic CodeGen differs from Swagger?

APIMatic provides SDKs with idiomatic code samples while the rest are generating wrappers around the CURL commands to give out language specific snippets.

How is language / framework compatibility maintained in the SDKs?

ans ?

Options for hosting single API portal with SDKs for multiple API specs?

If you have multiple APIs, you can stitch them up into a single API spec and use that specification to host an API portal with SDKs.

Do SDKs support GraphQL?

Currently, we do not have support of GraphQL in our SDKs.

What do API and an endpoint equate to?

API: an API for us is an API specification e.g an open API file. You can group multiple endpoints under that as per your choice and call them as a single API. For us, 1 API = 1 API spec (swagger, RAML, etc.) Endpoint: 1 unique call to a server. E.g. 1 post request and 1 get request are 2 unique API endpoints.

Is heavy use of discriminators supported in SDKs and portal?

allOf discriminators are supported in all SDKs.

APIMatic is adding random values to my required parameters in the code samples

To make sure that the code samples and the SDKs are runnable right out of the box, all required parameters should have a value. To ensure this, APIMatic adds random example values for required parameters if no example value is added in the API specification file. You can overwrite this random example value by passing valid examples for all your required parameters in the API specification file.

How to change controller names and why they get prefixed with random values?

Controllers only get prefixed for few languages and that too under the CodeGen setting "GenerateInterfaces". These controller names get prefixed with a fixed value "Default" Note that this setting is not widely used and therefore in majority of the cases, even for these languages there is no prefix. We only postfix for controller names which is configurable. By default the postfix is "Controller".

How to handle multiple schema options in oneOf/anyOf?

ans?

SDK is not showing example request and responses

This is a case of incomplete API specification. SDKs do not automatically add this information unless provided in the specification.

Why do example values for some parameters don't show up in code samples even though valid examples are added in the spec?

By default, SDKs don't show example values for optional parameters. To enable this feature, you can use the GenerateExamplesForOptionalFields CodeGen setting.

How does the GitHub deployment work?

Deploying an SDK to GitHub is quite seamless, simply provide access to your GitHub account and we can either push to a repository of your choice, or automatically create a new repository under your account.

What branch does APIMatic publish the SDKs to?

The branch name follows the format CodeGen-{platform} e.g., CodeGen-JAVA. This cannot be changed.

Can I make changes on the generated branch?

As part of the deployment process, we remove the contents of the branch and replace it with the contents of the SDK. Which means changes made on the generated branch will be lost in the next deployment. Ideally you should maintain your changes on a different branch (e.g master) and then pull/merge the generated branch.