Class TypeScriptFetchClientCodegen
- java.lang.Object
-
- org.openapitools.codegen.DefaultCodegen
-
- org.openapitools.codegen.languages.AbstractTypeScriptClientCodegen
-
- org.openapitools.codegen.languages.TypeScriptFetchClientCodegen
-
- All Implemented Interfaces:
CodegenConfig
public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodegen
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openapitools.codegen.languages.AbstractTypeScriptClientCodegen
AbstractTypeScriptClientCodegen.ParameterExpander
-
-
Field Summary
-
Fields inherited from class org.openapitools.codegen.languages.AbstractTypeScriptClientCodegen
classEnumSeparator, ENUM_PROPERTY_NAMING_REPLACE_SPECIAL_CHAR, ENUM_PROPERTY_NAMING_REPLACE_SPECIAL_CHAR_DESC, enumPropertyNaming, enumPropertyNamingReplaceSpecialChar, enumSuffix, languageGenericTypes, MODEL_PROPERTY_NAMING_DESC_WITH_WARNING, modelPropertyNaming, NPM_NAME, NPM_VERSION, npmName, npmVersion, NULL_SAFE_ADDITIONAL_PROPS, NULL_SAFE_ADDITIONAL_PROPS_DESC, nullSafeAdditionalProps, paramNaming, SNAPSHOT, SNAPSHOT_SUFFIX_FORMAT, supportsES6
-
Fields inherited from class org.openapitools.codegen.DefaultCodegen
additionalProperties, addOneOfInterfaceImports, addOneOfInterfaces, addSuffixToDuplicateOperationNicknames, allowUnicodeIdentifiers, apiDocTemplateFiles, apiNamePrefix, apiNameSuffix, apiPackage, apiTemplateFiles, apiTestTemplateFiles, cliOptions, DefaultFeatureSet, defaultIncludes, disallowAdditionalPropertiesIfNotPresent, docExtension, embeddedTemplateDir, enableMinimalUpdate, enablePostProcessFile, ensureUniqueParams, enumUnknownDefaultCase, enumUnknownDefaultCaseName, falseSchema, filesMetadataFilename, fileSuffix, generatorMetadata, gitHost, gitRepoId, gitUserId, hideGenerationTimestamp, httpUserAgent, ignoreFilePathOverride, importBaseType, importContainerType, importMapping, inlineSchemaNameMapping, inlineSchemaOption, inputSpec, instantiationTypes, JSON_MIME_PATTERN, JSON_VENDOR_MIME_PATTERN, languageSpecificPrimitives, legacyDiscriminatorBehavior, library, loadDeepObjectIntoItems, modelDocTemplateFiles, modelNameMapping, modelNamePrefix, modelNameSuffix, modelPackage, modelTemplateFiles, modelTestTemplateFiles, nameMapping, openAPI, openapiNormalizer, outputFolder, parameterNameMapping, prependFormOrBodyParameters, releaseNote, removeEnumValuePrefix, removeOperationIdPrefix, removeOperationIdPrefixCount, removeOperationIdPrefixDelimiter, reservedWords, reservedWordsMappings, schemaMapping, serverVariables, skipOperationExample, skipOverwrite, sortModelPropertiesByRequiredFlag, sortParamsByRequiredFlag, specialCharReplacements, strictSpecBehavior, supportedLibraries, supportingFiles, supportsAdditionalPropertiesWithComposedSchema, supportsInheritance, supportsMixins, supportsMultipleInheritance, templateDir, testPackage, trueSchema, typeAliases, typeMapping, useOneOfInterfaces, vendorExtensions, versionMetadataFilename, XML_MIME_PATTERN
-
-
Constructor Summary
Constructors Constructor Description TypeScriptFetchClientCodegen()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, io.swagger.v3.oas.models.media.Schema schema)
Handle the model for the 'additionalProperties' keyword in the OAS schema.protected com.google.common.collect.ImmutableMap.Builder<String,com.samskivert.mustache.Mustache.Lambda>
addMustacheLambdas()
Preset map builder with commonly used Mustache lambdas.String
escapeReservedWord(String name)
Return the escaped name of the reserved wordCodegenParameter
fromFormProperty(String name, io.swagger.v3.oas.models.media.Schema propertySchema, Set<String> imports)
org.openapitools.codegen.languages.TypeScriptFetchClientCodegen.ExtendedCodegenModel
fromModel(String name, io.swagger.v3.oas.models.media.Schema model)
Convert OAS Model object to Codegen Model object.org.openapitools.codegen.languages.TypeScriptFetchClientCodegen.ExtendedCodegenOperation
fromOperation(String path, String httpMethod, io.swagger.v3.oas.models.Operation operation, List<io.swagger.v3.oas.models.servers.Server> servers)
Convert OAS Operation object to Codegen Operation objectorg.openapitools.codegen.languages.TypeScriptFetchClientCodegen.ExtendedCodegenParameter
fromParameter(io.swagger.v3.oas.models.parameters.Parameter parameter, Set<String> imports)
Convert OAS Parameter object to Codegen Parameter objectorg.openapitools.codegen.languages.TypeScriptFetchClientCodegen.ExtendedCodegenProperty
fromProperty(String name, io.swagger.v3.oas.models.media.Schema p, boolean required)
TODO remove this in 7.0.0 as a breaking change This method was kept when required was added to the fromProperty signature to ensure that the change was non-breakingCodegenParameter
fromRequestBody(io.swagger.v3.oas.models.parameters.RequestBody body, Set<String> imports, String bodyParameterName)
List<CodegenParameter>
fromRequestBodyToFormParameters(io.swagger.v3.oas.models.parameters.RequestBody body, Set<String> imports)
String
getDetectPassthroughModelsWithSuffixAndField()
protected String
getEnumDefaultValue(String defaultValue, String dataType)
String
getHelp()
String
getImportFileExtension()
String
getInferEntityFromUniqueIdWithName()
boolean
getInferUniqueIdFromNameSuffix()
String
getName()
String
getNpmRepository()
boolean
getPackageAsSourceOnlyLibrary()
String
getPassthroughField()
String
getPassthroughSuffix()
Boolean
getSagasAndRecords()
Boolean
getStringEnums()
String
getTypeDeclaration(io.swagger.v3.oas.models.media.Schema p)
Output the language-specific type declaration of the property.Boolean
getWithoutRuntimeChecks()
boolean
isUniqueIdAccordingToNameSuffix(String name)
Map<String,ModelsMap>
postProcessAllModels(Map<String,ModelsMap> objs)
ModelsMap
postProcessModels(ModelsMap objs)
OperationsMap
postProcessOperationsWithModels(OperationsMap operations, List<ModelMap> allModels)
void
postProcessParameter(CodegenParameter parameter)
Map<String,Object>
postProcessSupportingFileData(Map<String,Object> objs)
void
processOpts()
void
setDetectPassthroughModelsWithSuffixAndField(String detectPassthroughModelsWithSuffixAndField)
void
setImportFileExtension(String importFileExtension)
void
setInferEntityFromUniqueIdWithName(String inferEntityFromUniqueIdWithName)
void
setInferUniqueIdFromNameSuffix(boolean inferUniqueIdFromNameSuffix)
void
setNpmRepository(String npmRepository)
void
setPackageAsSourceOnlyLibrary(boolean packageAsSourceOnlyLibrary)
void
setSagasAndRecords(Boolean sagasAndRecords)
void
setStringEnums(Boolean stringEnums)
void
setWithoutRuntimeChecks(Boolean withoutRuntimeChecks)
String
toEnumDefaultValue(String value, String datatype)
Return the enum default value in the language specified format-
Methods inherited from class org.openapitools.codegen.languages.AbstractTypeScriptClientCodegen
addImport, addPrefix, addSuffix, apiFileFolder, escapeQuotationMark, escapeText, escapeUnsafeCharacters, generatorLanguage, getEnumPropertyNaming, getModelPropertyNaming, getNpmName, getNpmVersion, getNullSafeAdditionalProps, getParameterDataType, getParamNaming, getSchemaType, getSupportsES6, getTag, getTypesFromSchemas, isEnumPropertyNamingReplaceSpecialChar, isReservedWord, modelFileFolder, postProcessFile, preprocessOpenAPI, setEnumPropertyNaming, setEnumPropertyNamingReplaceSpecialChar, setModelPropertyNaming, setNpmName, setNpmVersion, setNullSafeAdditionalProps, setParamNaming, setSupportsES6, supportModelPropertyNaming, toAllOfName, toAnyOfName, toDefaultValue, toEnumName, toEnumValue, toEnumVarName, toModelFilename, toModelImport, toModelImportMap, toModelName, toOneOfName, toOperationId, toParamName, toTypescriptTypeName, toVarName
-
Methods inherited from class org.openapitools.codegen.DefaultCodegen
addBodyModelSchema, addHeaders, addImport, addImport, addImports, addImports, addImports, addImportsForPropertyType, addImportsToOneOfInterface, additionalProperties, addOneOfInterfaceModel, addOneOfNameExtension, addOperationToGroup, addOption, addOption, addParentContainer, addProperties, addRegularExpressionDelimiter, addRequiredVarsMap, addSwitch, addVars, addVars, addVarsRequiredVarsAdditionalProps, apiDocFileFolder, apiDocFilename, apiDocTemplateFiles, apiFilename, apiPackage, apiTemplateFiles, apiTestFileFolder, apiTestFilename, apiTestTemplateFiles, buildEnumVars, buildLibraryCliOption, cliOptions, convertPropertyToBoolean, convertPropertyToBooleanAndWriteBack, createDiscriminator, defaultIncludes, defaultTemplatingEngine, embeddedTemplateDir, encodePath, escapeTextWhileAllowingNewLines, fileSuffix, findCommonPrefixOfVars, findMethodResponse, fromCallback, fromProperty, fromProperty, fromResponse, fromSecurity, fromServers, fromServerVariables, generateExamplePath, generateJSONSpecFile, generateYAMLSpecFile, generatorLanguageVersion, getAdditionalPropertiesName, getAddSuffixToDuplicateOperationNicknames, getAlias, getAllModels, getAllOfDescendants, getAllowUnicodeIdentifiers, getApiNamePrefix, getApiNameSuffix, getCollectionFormat, getCollectionFormat, getConsumesInfo, getContent, getContentType, getDisallowAdditionalPropertiesIfNotPresent, getDocExtension, getEnsureUniqueParams, getEnumUnknownDefaultCase, getFeatureSet, getFilesMetadataFilename, getGeneratorMetadata, getGitHost, getGitRepoId, getGitUserId, getHttpUserAgent, getIgnoreFilePathOverride, getInnerEnumAllowableValues, getInputSpec, getItemsName, getLegacyDiscriminatorBehavior, getLibrary, getModelNamePrefix, getModelNameSuffix, getModelNameToSchemaCache, getMostInnerItems, getOneOfAnyOfDescendants, getOrGenerateOperationId, getOutputDir, getPrependFormOrBodyParameters, getProducesInfo, getReleaseNote, getRemoveOperationIdPrefixCount, getRemoveOperationIdPrefixDelimiter, getSchemaAdditionalProperties, getSchemaFromBooleanOrSchema, getSchemaItems, getSingleSchemaType, getSortModelPropertiesByRequiredFlag, getSortParamsByRequiredFlag, getSupportedVendorExtensions, getSymbolName, getTemplatingEngine, getterAndSetterCapitalize, getTypeDeclaration, getUseInlineModelResolver, getUseOneOfInterfaces, getUseOpenAPINormalizer, getVersionMetadataFilename, handleMethodResponse, handleMethodResponse, handleSpecialCharacters, hasBodyParameter, hasFormParameter, importMapping, initializeSpecialCharacterMapping, inlineSchemaNameMapping, inlineSchemaOption, instantiationTypes, isAnyTypeSchema, isDataTypeBinary, isDataTypeFile, isDataTypeString, isEnableMinimalUpdate, isEnablePostProcessFile, isHideGenerationTimestamp, isJsonMimeType, isJsonVendorMimeType, isLibrary, isParameterNameUnique, isPropertyInnerMostEnum, isRemoveEnumValuePrefix, isRemoveOperationIdPrefix, isSkipOperationExample, isSkipOverwrite, isStrictSpecBehavior, isXmlMimeType, languageSpecificPrimitives, lowerCamelCase, modelDocFileFolder, modelDocTemplateFiles, modelFilename, modelNameMapping, modelPackage, modelTemplateFiles, modelTestFileFolder, modelTestTemplateFiles, modifyFeatureSet, nameMapping, needToImport, openapiNormalizer, outputFolder, parameterNameMapping, postProcess, postProcessModelProperty, postProcessModelsEnum, processCompiler, processOpenAPI, processTemplatingEngine, processTestExampleData, removeImport, removeNonNameElementToCamelCase, removeNonNameElementToCamelCase, removeOption, removeSelfReferenceImports, reservedWords, reservedWordsMappings, sanitizeName, sanitizeName, sanitizeName, sanitizeTag, schemaMapping, serverVariableOverrides, setAddProps, setAllowUnicodeIdentifiers, setApiNamePrefix, setApiNameSuffix, setApiPackage, setCircularReferences, setDisallowAdditionalPropertiesIfNotPresent, setDocExtension, setEnableMinimalUpdate, setEnablePostProcessFile, setEnsureUniqueParams, setEnumUnknownDefaultCase, setFilesMetadataFilename, setGitHost, setGitRepoId, setGitUserId, setHideGenerationTimestamp, setHttpUserAgent, setIgnoreFilePathOverride, setInputSpec, setLegacyDiscriminatorBehavior, setLibrary, setModelNamePrefix, setModelNameSuffix, setModelPackage, setNonArrayMapProperty, setOpenAPI, setOutputDir, setParameterBooleanFlagWithCodegenProperty, setParameterEncodingValues, setParameterExamples, setParameterExampleValue, setParameterExampleValue, setParameterExampleValue, setParameterNullable, setPrependFormOrBodyParameters, setReleaseNote, setRemoveEnumValuePrefix, setRemoveOperationIdPrefix, setRemoveOperationIdPrefixCount, setRemoveOperationIdPrefixDelimiter, setReservedWordsLowerCase, setSkipOperationExample, setSkipOverwrite, setSortModelPropertiesByRequiredFlag, setSortParamsByRequiredFlag, setStrictSpecBehavior, setTemplateDir, setTemplatingEngine, setUseOneOfInterfaces, setVersionMetadataFilename, shouldAddImport, shouldOverwrite, supportedLibraries, supportingFiles, templateDir, testPackage, toApiDocFilename, toApiFilename, toApiImport, toApiName, toApiTestFilename, toApiVarName, toArrayModelParamName, toBooleanGetter, toDefaultParameterValue, toDefaultParameterValue, toDefaultValue, toDefaultValueWithParam, toExamples, toExampleValue, toGetter, toInstantiationType, toMediaTypeSchemaName, toModelDocFilename, toModelTestFilename, toRegularExpression, toSetter, toTestCaseName, typeMapping, unaliasPropertySchema, unaliasSchema, updateAllModels, updateCodegenPropertyEnum, updateDataTypeWithEnumForArray, updateDataTypeWithEnumForMap, updateEnumVarsWithExtensions, updateModelForAnyType, updateModelForComposedSchema, updateModelForInteger, updateModelForNumber, updateModelForObject, updateModelForString, updateOption, updateParameterForString, updatePropertyForAnyType, updatePropertyForArray, updatePropertyForInteger, updatePropertyForMap, updatePropertyForMap, updatePropertyForNumber, updatePropertyForObject, updatePropertyForString, updateRequestBodyForArray, updateRequestBodyForMap, updateRequestBodyForObject, updateRequestBodyForPrimitiveType, updateRequestBodyForString, vendorExtensions, writePropertyBack
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openapitools.codegen.CodegenConfig
additionalProperties, addOperationToGroup, apiDocFileFolder, apiDocFilename, apiDocTemplateFiles, apiFilename, apiPackage, apiTemplateFiles, apiTestFileFolder, apiTestFilename, apiTestTemplateFiles, cliOptions, defaultIncludes, defaultTemplatingEngine, embeddedTemplateDir, encodePath, escapeTextWhileAllowingNewLines, fileSuffix, fromSecurity, fromServers, fromServerVariables, generateExamplePath, generatorLanguageVersion, getAddSuffixToDuplicateOperationNicknames, getDocExtension, getFeatureSet, getFilesMetadataFilename, getGeneratorMetadata, getGitHost, getGitRepoId, getGitUserId, getHttpUserAgent, getIgnoreFilePathOverride, getInputSpec, getLibrary, getOutputDir, getReleaseNote, getSupportedVendorExtensions, getTemplatingEngine, getTypeDeclaration, getUseInlineModelResolver, getUseOpenAPINormalizer, getVersionMetadataFilename, importMapping, inlineSchemaNameMapping, inlineSchemaOption, instantiationTypes, isEnableMinimalUpdate, isEnablePostProcessFile, isHideGenerationTimestamp, isRemoveEnumValuePrefix, isRemoveOperationIdPrefix, isSkipOperationExample, isSkipOverwrite, isStrictSpecBehavior, languageSpecificPrimitives, modelDocFileFolder, modelDocTemplateFiles, modelFilename, modelNameMapping, modelPackage, modelTemplateFiles, modelTestFileFolder, modelTestTemplateFiles, nameMapping, openapiNormalizer, outputFolder, parameterNameMapping, postProcess, postProcessModelProperty, processCompiler, processOpenAPI, processTemplatingEngine, reservedWords, reservedWordsMappings, sanitizeName, sanitizeTag, schemaMapping, serverVariableOverrides, setDocExtension, setEnableMinimalUpdate, setEnablePostProcessFile, setGitHost, setGitRepoId, setGitUserId, setHideGenerationTimestamp, setHttpUserAgent, setIgnoreFilePathOverride, setInputSpec, setLibrary, setOpenAPI, setOutputDir, setReleaseNote, setRemoveEnumValuePrefix, setRemoveOperationIdPrefix, setSkipOperationExample, setSkipOverwrite, setStrictSpecBehavior, setTemplatingEngine, shouldOverwrite, supportedLibraries, supportingFiles, templateDir, testPackage, toApiDocFilename, toApiFilename, toApiImport, toApiName, toApiTestFilename, toApiVarName, toBooleanGetter, toGetter, toModelDocFilename, toModelTestFilename, toSetter, typeMapping, unaliasSchema, updateAllModels, vendorExtensions
-
-
-
-
Field Detail
-
NPM_REPOSITORY
public static final String NPM_REPOSITORY
- See Also:
- Constant Field Values
-
WITH_INTERFACES
public static final String WITH_INTERFACES
- See Also:
- Constant Field Values
-
USE_SINGLE_REQUEST_PARAMETER
public static final String USE_SINGLE_REQUEST_PARAMETER
- See Also:
- Constant Field Values
-
PREFIX_PARAMETER_INTERFACES
public static final String PREFIX_PARAMETER_INTERFACES
- See Also:
- Constant Field Values
-
WITHOUT_RUNTIME_CHECKS
public static final String WITHOUT_RUNTIME_CHECKS
- See Also:
- Constant Field Values
-
STRING_ENUMS
public static final String STRING_ENUMS
- See Also:
- Constant Field Values
-
STRING_ENUMS_DESC
public static final String STRING_ENUMS_DESC
- See Also:
- Constant Field Values
-
IMPORT_FILE_EXTENSION_SWITCH
public static final String IMPORT_FILE_EXTENSION_SWITCH
- See Also:
- Constant Field Values
-
IMPORT_FILE_EXTENSION_SWITCH_DESC
public static final String IMPORT_FILE_EXTENSION_SWITCH_DESC
- See Also:
- Constant Field Values
-
npmRepository
protected String npmRepository
-
importFileExtension
protected String importFileExtension
-
addedApiIndex
protected boolean addedApiIndex
-
addedModelIndex
protected boolean addedModelIndex
-
withoutRuntimeChecks
protected boolean withoutRuntimeChecks
-
stringEnums
protected boolean stringEnums
-
SAGAS_AND_RECORDS
public static final String SAGAS_AND_RECORDS
- See Also:
- Constant Field Values
-
DETECT_PASSTHROUGH_MODELS_WITH_SUFFIX_AND_FIELD
public static final String DETECT_PASSTHROUGH_MODELS_WITH_SUFFIX_AND_FIELD
- See Also:
- Constant Field Values
-
INFER_UNIQUE_ID_FROM_NAME_SUFFIX
public static final String INFER_UNIQUE_ID_FROM_NAME_SUFFIX
- See Also:
- Constant Field Values
-
INFER_ENTITY_FROM_UNIQUE_ID_WITH_NAME
public static final String INFER_ENTITY_FROM_UNIQUE_ID_WITH_NAME
- See Also:
- Constant Field Values
-
PACKAGE_AS_SOURCE_ONLY_LIBRARY
public static final String PACKAGE_AS_SOURCE_ONLY_LIBRARY
- See Also:
- Constant Field Values
-
sagasAndRecords
protected boolean sagasAndRecords
-
detectPassthroughModelsWithSuffixAndField
protected String detectPassthroughModelsWithSuffixAndField
-
inferUniqueIdFromNameSuffix
protected boolean inferUniqueIdFromNameSuffix
-
inferEntityFromUniqueIdWithName
protected String inferEntityFromUniqueIdWithName
-
packageAsSourceOnlyLibrary
protected boolean packageAsSourceOnlyLibrary
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getName
in interfaceCodegenConfig
- Overrides:
getName
in classDefaultCodegen
-
getHelp
public String getHelp()
- Specified by:
getHelp
in interfaceCodegenConfig
- Overrides:
getHelp
in classDefaultCodegen
-
getNpmRepository
public String getNpmRepository()
-
setNpmRepository
public void setNpmRepository(String npmRepository)
-
getImportFileExtension
public String getImportFileExtension()
-
setImportFileExtension
public void setImportFileExtension(String importFileExtension)
-
getWithoutRuntimeChecks
public Boolean getWithoutRuntimeChecks()
-
setWithoutRuntimeChecks
public void setWithoutRuntimeChecks(Boolean withoutRuntimeChecks)
-
getStringEnums
public Boolean getStringEnums()
-
setStringEnums
public void setStringEnums(Boolean stringEnums)
-
getSagasAndRecords
public Boolean getSagasAndRecords()
-
setSagasAndRecords
public void setSagasAndRecords(Boolean sagasAndRecords)
-
getPassthroughSuffix
public String getPassthroughSuffix()
-
getPassthroughField
public String getPassthroughField()
-
getDetectPassthroughModelsWithSuffixAndField
public String getDetectPassthroughModelsWithSuffixAndField()
-
setDetectPassthroughModelsWithSuffixAndField
public void setDetectPassthroughModelsWithSuffixAndField(String detectPassthroughModelsWithSuffixAndField)
-
getInferUniqueIdFromNameSuffix
public boolean getInferUniqueIdFromNameSuffix()
-
setInferUniqueIdFromNameSuffix
public void setInferUniqueIdFromNameSuffix(boolean inferUniqueIdFromNameSuffix)
-
getInferEntityFromUniqueIdWithName
public String getInferEntityFromUniqueIdWithName()
-
setInferEntityFromUniqueIdWithName
public void setInferEntityFromUniqueIdWithName(String inferEntityFromUniqueIdWithName)
-
getPackageAsSourceOnlyLibrary
public boolean getPackageAsSourceOnlyLibrary()
-
setPackageAsSourceOnlyLibrary
public void setPackageAsSourceOnlyLibrary(boolean packageAsSourceOnlyLibrary)
-
isUniqueIdAccordingToNameSuffix
public boolean isUniqueIdAccordingToNameSuffix(String name)
-
processOpts
public void processOpts()
- Specified by:
processOpts
in interfaceCodegenConfig
- Overrides:
processOpts
in classAbstractTypeScriptClientCodegen
-
toEnumDefaultValue
public String toEnumDefaultValue(String value, String datatype)
Description copied from class:DefaultCodegen
Return the enum default value in the language specified format- Overrides:
toEnumDefaultValue
in classAbstractTypeScriptClientCodegen
- Parameters:
value
- enum variable namedatatype
- data type- Returns:
- the default value for the enum
-
getEnumDefaultValue
protected String getEnumDefaultValue(String defaultValue, String dataType)
- Overrides:
getEnumDefaultValue
in classDefaultCodegen
-
addMustacheLambdas
protected com.google.common.collect.ImmutableMap.Builder<String,com.samskivert.mustache.Mustache.Lambda> addMustacheLambdas()
Description copied from class:DefaultCodegen
Preset map builder with commonly used Mustache lambdas. To extend the map, override addMustacheLambdas(), call parent method first and then add additional lambdas to the returned builder. If common lambdas are not desired, override addMustacheLambdas() method and return empty builder.- Overrides:
addMustacheLambdas
in classDefaultCodegen
- Returns:
- preinitialized map with common lambdas
-
getTypeDeclaration
public String getTypeDeclaration(io.swagger.v3.oas.models.media.Schema p)
Description copied from class:DefaultCodegen
Output the language-specific type declaration of the property.- Specified by:
getTypeDeclaration
in interfaceCodegenConfig
- Overrides:
getTypeDeclaration
in classAbstractTypeScriptClientCodegen
- Parameters:
p
- property schema- Returns:
- a string presentation of the property type
-
addAdditionPropertiesToCodeGenModel
protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, io.swagger.v3.oas.models.media.Schema schema)
Description copied from class:DefaultCodegen
Handle the model for the 'additionalProperties' keyword in the OAS schema.- Overrides:
addAdditionPropertiesToCodeGenModel
in classDefaultCodegen
- Parameters:
codegenModel
- The codegen representation of the schema.schema
- The input OAS schema.
-
postProcessModels
public ModelsMap postProcessModels(ModelsMap objs)
- Specified by:
postProcessModels
in interfaceCodegenConfig
- Overrides:
postProcessModels
in classAbstractTypeScriptClientCodegen
-
postProcessParameter
public void postProcessParameter(CodegenParameter parameter)
- Specified by:
postProcessParameter
in interfaceCodegenConfig
- Overrides:
postProcessParameter
in classDefaultCodegen
-
postProcessAllModels
public Map<String,ModelsMap> postProcessAllModels(Map<String,ModelsMap> objs)
- Specified by:
postProcessAllModels
in interfaceCodegenConfig
- Overrides:
postProcessAllModels
in classAbstractTypeScriptClientCodegen
-
fromRequestBodyToFormParameters
public List<CodegenParameter> fromRequestBodyToFormParameters(io.swagger.v3.oas.models.parameters.RequestBody body, Set<String> imports)
- Overrides:
fromRequestBodyToFormParameters
in classDefaultCodegen
-
fromParameter
public org.openapitools.codegen.languages.TypeScriptFetchClientCodegen.ExtendedCodegenParameter fromParameter(io.swagger.v3.oas.models.parameters.Parameter parameter, Set<String> imports)
Description copied from class:DefaultCodegen
Convert OAS Parameter object to Codegen Parameter object- Overrides:
fromParameter
in classDefaultCodegen
- Parameters:
parameter
- OAS parameter objectimports
- set of imports for library/package/module- Returns:
- Codegen Parameter object
-
fromFormProperty
public CodegenParameter fromFormProperty(String name, io.swagger.v3.oas.models.media.Schema propertySchema, Set<String> imports)
- Overrides:
fromFormProperty
in classDefaultCodegen
-
fromRequestBody
public CodegenParameter fromRequestBody(io.swagger.v3.oas.models.parameters.RequestBody body, Set<String> imports, String bodyParameterName)
- Overrides:
fromRequestBody
in classDefaultCodegen
-
fromProperty
public org.openapitools.codegen.languages.TypeScriptFetchClientCodegen.ExtendedCodegenProperty fromProperty(String name, io.swagger.v3.oas.models.media.Schema p, boolean required)
Description copied from class:DefaultCodegen
TODO remove this in 7.0.0 as a breaking change This method was kept when required was added to the fromProperty signature to ensure that the change was non-breaking- Overrides:
fromProperty
in classDefaultCodegen
- Parameters:
name
- name of the propertyp
- OAS property schemarequired
- true if the property is required in the next higher object schema, false otherwise- Returns:
- Codegen Property object
-
fromModel
public org.openapitools.codegen.languages.TypeScriptFetchClientCodegen.ExtendedCodegenModel fromModel(String name, io.swagger.v3.oas.models.media.Schema model)
Description copied from class:DefaultCodegen
Convert OAS Model object to Codegen Model object.- Specified by:
fromModel
in interfaceCodegenConfig
- Overrides:
fromModel
in classDefaultCodegen
- Parameters:
name
- the name of the modelmodel
- OAS Model object- Returns:
- Codegen Model object
-
fromOperation
public org.openapitools.codegen.languages.TypeScriptFetchClientCodegen.ExtendedCodegenOperation fromOperation(String path, String httpMethod, io.swagger.v3.oas.models.Operation operation, List<io.swagger.v3.oas.models.servers.Server> servers)
Description copied from class:DefaultCodegen
Convert OAS Operation object to Codegen Operation object- Specified by:
fromOperation
in interfaceCodegenConfig
- Overrides:
fromOperation
in classDefaultCodegen
- Parameters:
path
- the path of the operationhttpMethod
- HTTP methodoperation
- OAS operation objectservers
- list of servers- Returns:
- Codegen Operation object
-
escapeReservedWord
public String escapeReservedWord(String name)
Description copied from class:DefaultCodegen
Return the escaped name of the reserved word- Specified by:
escapeReservedWord
in interfaceCodegenConfig
- Overrides:
escapeReservedWord
in classAbstractTypeScriptClientCodegen
- Parameters:
name
- the name to be escaped- Returns:
- the escaped reserved word
throws Runtime exception as reserved word is not allowed (default behavior)
-
postProcessOperationsWithModels
public OperationsMap postProcessOperationsWithModels(OperationsMap operations, List<ModelMap> allModels)
- Specified by:
postProcessOperationsWithModels
in interfaceCodegenConfig
- Overrides:
postProcessOperationsWithModels
in classDefaultCodegen
-
postProcessSupportingFileData
public Map<String,Object> postProcessSupportingFileData(Map<String,Object> objs)
- Specified by:
postProcessSupportingFileData
in interfaceCodegenConfig
- Overrides:
postProcessSupportingFileData
in classDefaultCodegen
-
-