swagger-typescript-api
swagger-typescript-api copied to clipboard
Feature request: 'interfacePrefix'
Hi! First of all thanks for this project!
Currently, there are several props for prefix\suffix settings:
typePrefix: '',
typeSuffix: '',
enumKeyPrefix: '',
enumKeySuffix: '',
But the one is missing is interfacePrefix (and interfaceSuffix).
Ideally, I want to have a "T" prefix for my types, and "I" for my interfaces, as far as I understand, currently it's impossible, and typePrefix will be applied to both types and interfaces.
Thanks!
I'm trying override the ETA-templates but it has no effects. For example in type inheritance
hi @js2me, what do you think about it?
I'm trying override the
ETA-templates but it has no effects. For example in type inheritance
@chiralium The template to override is data-contracts.ejs
const dataContractTemplates = {
enum: (contract) => {
return `enum ${contract.name} {\r\n${contract.content} \r\n }`;
},
interface: (contract) => {
/**
* Add your prefix/suffix here
*/
return `interface I${contract.name} {\r\n${contract.content}}`;
},
type: (contract) => {
return `type ${contract.name} = ${contract.content}`;
},
}
I'm trying override the
ETA-templates but it has no effects. For example in type inheritance@chiralium The template to override is
data-contracts.ejsconst dataContractTemplates = { enum: (contract) => { return `enum ${contract.name} {\r\n${contract.content} \r\n }`; }, interface: (contract) => { /** * Add your prefix/suffix here */ return `interface I${contract.name} {\r\n${contract.content}}`; }, type: (contract) => { return `type ${contract.name} = ${contract.content}`; }, }
This template override the interface definition, but not the extends part where super-interface has no prefix
any news?