Define & Validate APIsManage API Definitions

Import and Export Settings

Settings in the APIMatic Metadata file that change how your API definition is read, and how it's written when you transform it.

Import settings change how APIMatic reads your API definition. Export settings change how it's written when you transform it to another format. Both go at the top level of the APIMatic Metadata file. Set only the ones you want to change; the rest keep their defaults.

APIMatic ignores keys it doesn't recognize under ImportSettings, so check the spelling of each setting name. Keys it doesn't recognize under ExportSettings are reported by the Metadata File Validation ruleset.

src/spec/APIMATIC-META.json
{
  "ImportSettings": {
    "PreferSwaggerOperationSummaryOverId": true,
    "ImportMultipleAuthentication": false
  },
  "ExportSettings": {
    "ExportExtensions": true
  }
}

Import settings

All import settings are booleans except ExampleResolvingMaxDepth.

Naming

SettingDefaultWhat it does
PreferJsonSchemaNameOverTitlefalseNames models after their definition name instead of their title.
AppendParentNameForClashesfalseWhen two models have the same name, adds the parent's name instead of a number.
IgnoreRamlTypeDeclarationDisplayNamefalseRAML 1.0: ignores displayName and uses the declared key name.
PreferSwaggerOperationSummaryOverIdfalseOpenAPI: names endpoints from summary instead of operationId.
IgnoreEndpointSummaryfalseOpenAPI 3: doesn't import an operation's summary as the endpoint summary. Instead, it's used as the endpoint description when the operation has no description.

Models and schemas

SettingDefaultWhat it does
ExampleResolvingMaxDepth1Integer. How many levels of nested objects become models when a model is built from a JSON example. For formats whose models come only from examples, such as Postman, HAR, and RAML 1.0, the default 1 is raised to 10.
AllowModelTypesWithNoFieldsfalseImports models that have no properties.
ImportArrayOfMapsAndMapOfArraysfalseImports arrays of maps and maps of arrays with their types, instead of as dynamic types.
ImportOpenApi3EmptySchematrueOpenAPI 3: keeps empty schemas. When false, they're treated as undeclared.
ImportCustomTypeAdditionalFieldstrueImports additionalProperties defined in schemas that also define properties or use allOf, oneOf, or anyOf.
ImportUnusedCustomTypestrueOpenAPI 3: when false, removes models that nothing in the API uses.
RemoveUndeclaredPropertiesFromExamplenot setRemoves example properties that aren't in the schema. Turns on automatically with RemoveSchemaPropertiesWithTags or RemoveInformationWithTags unless you set it to false.

Type combinators

SettingDefaultWhat it does
ImportTypeCombinatorstrueImports oneOf, anyOf, not, and union types along with the extra types they need.
ImportTypeCombinatorsWithOnlyOneTypetrueWhen false, a combinator with a single type is replaced by that type.
ImportAdditionalTypeCombinatorModelstrueWhen false, doesn't create a model for a schema that uses oneOf or anyOf. The schema is imported as a generic object that holds the combinator's types.
PromoteInlineTypeCombinatorsToGlobalfalseTurns inline oneOf, anyOf, and not combinators that aren't defined as named schemas into global type combinators with generated names.
LoadOneOfAsOptionalFieldsfalseMerges oneOf schemas into one model whose fields are all optional.
UseRamlUnionTypeAsOneOftrueRAML 1.0: loads union types as oneOf. When false, loads them as anyOf.
LoadBaseTypesForOneOfAnyOfDiscriminatorfalseCreates base types where a discriminator is used with oneOf or anyOf.
AppendParentSchemaNameToOneOfAnyOfBaseTypefalseAdds the parent schema's name to those generated base types.
ImportFromOpenApiDiscriminatorMappingtrueOpenAPI 3: imports the discriminator mapping.

Enums

SettingDefaultWhat it does
IgnoreInlineEnumModelDescriptionfalseIgnores descriptions defined inline on enum schemas.
PreserveSingleValueEnumfalseKeeps a single-value enum on a required property as an enum instead of turning it into a constant.
AllowAdditionalEnumItemsfalseLets enums accept values that aren't listed.

Responses and requests

SettingDefaultWhat it does
ImportMultipleResponsestrueWhen false, keeps only responses with status codes 200–208 and 400–599, and drops the types the others need.
ImportAdditionalErrorModelstrueOpenAPI 3: imports 4XX, 5XX, and default responses as endpoint errors. When false, they're skipped.
ImportRequestBodyContentTypeHeadertrueImports the request content type as an explicit Content-Type header.
ImportWsdlWithJsonMediaTypesfalseWSDL: treats application/xml media types as JSON and skips XML metadata.
ImportHeadOptionsTraceOperationsfalseOpenAPI 3.x and Swagger 2.0: imports operations under head, options, and trace as endpoints. When false, they're skipped with a warning. Other formats never import these methods.

Authentication

SettingDefaultWhat it does
ImportMultipleAuthenticationtrueWhen false, imports only the first authentication scheme.
ImportAdditionalHeadertrueOpenAPI 3: adds the header of each API key security scheme to the API's additional headers. When false, it isn't added.
EnableCookieAuthenticationfalseOpenAPI 3: imports cookie authentication schemes.
AllowAuthForEmptySecurityObjectfalseOpenAPI 3: when ImportMultipleAuthentication is false, still applies authentication to an operation whose first security requirement is an empty object ({}).

Validation

SettingDefaultWhat it does
UseStrictValidationfalseOpenAPI 3.0 and Swagger 2.0: runs the format's own validation and linting during import, and stops the import if they report an error.

Export settings

All export settings are booleans.

All formats

SettingDefaultWhat it does
ExportExtensionsfalseExports extensions when the output format supports them.
ExportAnyTypetrueWhen false, exports any as object or string.

OpenAPI and RAML

SettingDefaultWhat it does
AddRefSiblingDataInAllOfSchematrueOpenAPI 2.0 and 3.x: keeps data that sits next to a $ref by wrapping it in allOf. When false, that data is dropped.
ExportXmlMetaDatatrueExports XML metadata such as node name, namespace, and prefix (OpenAPI 2.0, 3.x, RAML 1.0).
ExportDiscriminatorMappingValuestrueOpenAPI 3: exports discriminator values in mapping.
ExportGlobalTypeCombinatorstrueOpenAPI 3.0 and RAML: defines type combinators once and references them. When false, they're written inline.
UseDateTimeOnlyInRamlfalseRAML 1.0: exports date-time fields as datetime-only instead of datetime.

Postman and Insomnia

SettingDefaultWhat it does
GenerateModelSamplestruePostman and Insomnia: generates sample values for parameters, requests, and responses. Defaults to false when the input is WSDL or WADL.
SetPostmanParamValuesAsVariablesfalsePostman: stores sample query and path parameter values as collection variables.
EncodeUrlParamsInPostmantruePostman: URL-encodes request URLs.
ExportApiKeyAuthInPostmantruePostman: uses Postman's API key auth type. When false, adds the key as a parameter.
UseEnvironmentNamesForServerVariablesfalsePostman: adds environment names to server variable names.
ExportOptionalParametersAsDisabledfalsePostman and Insomnia: marks optional parameters as disabled.
GenerateSampleValueFromRegexPatternfalsePostman and Insomnia: generates sample values from regex patterns. Off by default because it's slow.
ForceAllowModelExampleExportForSampleGenerationfalsePostman and Insomnia: reuses model-level examples for samples.

WSDL and XML

SettingDefaultWhat it does
UseHttpMethodPrefixForAutoGeneratedWsdlNamestrueWSDL: prefixes generated names with the HTTP method.
UseXsdBase64BinaryTypefalseXML Schema: exports files and binary data as xs:base64Binary instead of xs:hexBinary.

GraphQL

SettingDefaultWhat it does
UseHttpPrefixInQueryNamestrueStarts each operation name with a verb that matches its HTTP method, such as Get or Delete, unless the name already starts with one. Defaults to false when the input is WSDL.

On this page